package com.hdsx.jxcsxm.tjbb.controller;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.hdsx.jxcsxm.utile.*;

import net.sf.json.JSONArray;
import net.sf.json.JsonConfig;

import org.apache.struts2.ServletActionContext;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.hdsx.jxcsxm.tjbb.bean.ExcelData;
import com.hdsx.jxcsxm.tjbb.bean.Excel_export;
import com.hdsx.jxcsxm.tjbb.bean.Excel_list;
import com.hdsx.jxcsxm.tjbb.bean.Excel_tilte;
import com.hdsx.jxcsxm.tjbb.server.TjbbServer;
import com.hdsx.jxcsxm.xtgl.bean.TreeNode;
import com.hdsx.jxcsxm.xtgl.bean.Xmjbxx;
import com.hdsx.webutil.struts.BaseActionSupport;
import com.opensymphony.xwork2.ModelDriven;



/**
 * Controller层
 * @author qwh
 *
 */
@SuppressWarnings("serial")
@Scope("prototype")
@Controller
public class TjbbController extends BaseActionSupport implements ModelDriven<Excel_list>{

	@Resource(name = "tjbbServerImpl")
	private TjbbServer tjbbServer;
	private Xmjbxx xmjbxx=new Xmjbxx();
	private int page=1;
	private int rows=10;
	private Excel_list elist=new Excel_list();
	private File fileupload;
	private String fileuploadFileName;

	@Override
	public Excel_list getModel() {
		return elist;
	}

	public Xmjbxx getXmjbxx() {
		return xmjbxx;
	}

	public void setXmjbxx(Xmjbxx xmjbxx) {
		this.xmjbxx = xmjbxx;
	}

	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public int getRows() {
		return rows;
	}

	public void setRows(int rows) {
		this.rows = rows;
	}

	public File getFileupload() {
		return fileupload;
	}

	public void setFileupload(File fileupload) {
		this.fileupload = fileupload;
	}

	public String getFileuploadFileName() {
		return fileuploadFileName;
	}

	public void setFileuploadFileName(String fileuploadFileName) {
		this.fileuploadFileName = fileuploadFileName;
	}

	public void createBtTree(){

		List<TreeNode> l=tjbbServer.createBtTree(elist);
		TreeNode root = returnRoot1(l,l.get(0));
		List<TreeNode> children1 = new ArrayList<TreeNode>();
		children1.add(l.get(0));
		List<TreeNode> children = root.getChildren();
		children1.get(0).setChildren(children);
		try{
			String s=JSONArray.fromObject(children1).toString();
			ResponseUtils.write(getresponse(), s);
		} catch (Exception e) {
			e.printStackTrace();
		}

	}
	private TreeNode returnRoot1(List<TreeNode> list, TreeNode zzjgTree){
		for(TreeNode temp : list){
			if(temp!=zzjgTree){
				if(temp.getParent() != null &&temp.getParent() !="" && temp.getParent().equals(zzjgTree.getId())){
					if(zzjgTree.getId().indexOf("v")!=-1){
						zzjgTree.setState("close");
					}
					else{
						zzjgTree.setState("open");
					}
					zzjgTree.getChildren().add(temp);
					returnRoot1(list,temp);
				}
			}
		}
		return zzjgTree;
	}

	//获取jsp页面自定义表头
	public void getZdyBbzd(){
		try {

			List<Excel_list> list=new ArrayList<Excel_list>();
			list=tjbbServer.getZdyBbzd(elist);
			//以上代码就是为了获取SQL语句的查询结果，并且封装到了一个实体里面。以下的这一段代码是在拼接表头。
			String html="<tr>";
			String rowxh="0";
			for(int i=0;i<list.size();i++){
				if(!rowxh.equals(list.get(i).getRowxh())){
					html=html+"</tr><tr>";
					rowxh=list.get(i).getRowxh();
				}

				if("".equals(list.get(i).getWidth())||list.get(i).getWidth()==null){
					html=html+"<td rowspan='"+list.get(i).getHight()+"'  colspan='"+list.get(i).getCo()+"'>"+list.get(i).getName()+"</td>";
				}else{
					html=html+"<td style='width:"+list.get(i).getWidth()+"px;' rowspan='"+list.get(i).getHight()+"'  colspan='"+list.get(i).getCo()+"'>"+list.get(i).getName()+"</td>";
				}
			}
			html=html+"</tr>";
			System.out.println(html);
			Excel_list e=new Excel_list();
			e.setCol(html);
			JsonUtils.write(e, getresponse().getWriter());
		} catch (Exception e1) {

			e1.printStackTrace();
		}
	}


	public void getJhzxqkb(){
		try {
			elist.setXmlx(MyUtil.getQueryxmlxTJ(elist.getXmlx(), "xm.jsxz","xm.gcfl"));
			elist.setJhxdwh(MyUtil.getQueryTJIN(elist.getJhxdwh(), "jhxdwh"));
			elist.setXzqhdm(MyUtil.getQueryTJ(elist.getXzqhdm(), "xm.xzqhdm"));
//			elist.setXmnf(MyUtil.getQueryTJ(elist.getJhnf(), "xdnf"));
			elist.setXmnf("");
			elist.setJhnf(MyUtil.getQueryTJ(elist.getJhnf(), "xm.xdnf"));
			elist.setGydwdm(MyUtil.getQueryDwTJ(elist.getGydw(), "xm.gydwdm","xm.sgydwdm"));
			elist.setTsdq(MyUtil.getQueryTJ(elist.getTsdq() ,"tsdq"));
			if ("1".equals(elist.getFlag())) {
				ExcelData eldata=new ExcelData();//创建一个类
				eldata.setTitleName("计划执行情况表");//设置第一行
				eldata.setSheetName("sheet1");//设置sheeet名
				eldata.setFileName("计划执行情况表");//设置文件名

				List<Excel_tilte> et=new ArrayList<Excel_tilte>();//创建一个list存放表头
				List<Excel_list> list=new ArrayList<Excel_list>();
				HttpServletRequest request = ServletActionContext.getRequest();
				HttpSession session = request.getSession();
				String username = (String)session.getAttribute("truename");
				list=(List<Excel_list>) session.getAttribute("zxqkblist");
				et.add(new Excel_tilte("填报单位：",1,1,0,0));
				et.add(new Excel_tilte(username,1,1,1,1));
				et.add(new Excel_tilte("",1,1,2,14));
				et.add(new Excel_tilte("数据统计截止时间：",1,1,15,15));

				et.add(new Excel_tilte(elist.getBbsj(),1,1,16,16));
				et.add(new Excel_tilte("",1,1,17,29));
				et.add(new Excel_tilte("单位：万元",1,1,30,30));

				et.add(new Excel_tilte("序号",2,4,0,0));
				et.add(new Excel_tilte("计划文号",2,4,1,1));
				et.add(new Excel_tilte("项目单位",2,4,2,2));
				et.add(new Excel_tilte("项目名称",2,4,3,3));
				et.add(new Excel_tilte("项目工程量完成情况",2,2,4,7));
				et.add(new Excel_tilte("资金情况",2,2,8,30));

				et.add(new Excel_tilte("总投资（万元）",3,4,4,4));
				et.add(new Excel_tilte("完成量（公里/延米/）",3,4,5,5));
				et.add(new Excel_tilte("完成投资（万元）",3,4,6,6));
				et.add(new Excel_tilte("完成比例(%)",3,4,7,7));
				et.add(new Excel_tilte("下达计划情况",3,3,8,12));
				et.add(new Excel_tilte("资金到位情况",3,3,13,17));
				et.add(new Excel_tilte("资金拨付情况",3,3,18,22));
				et.add(new Excel_tilte("资金结余情况",3,3,23,27));
				et.add(new Excel_tilte("资金到位比例",3,4,28,28));
				et.add(new Excel_tilte("资金拨付比例",3,4,29,29));
				et.add(new Excel_tilte("计划执行情况",3,4,30,30));

				et.add(new Excel_tilte("小计",4,4,8,8));
				et.add(new Excel_tilte("车购税",4,4,9,9));
				et.add(new Excel_tilte("燃油税",4,4,10,10));
				et.add(new Excel_tilte("厅统筹",4,4,11,11));
				et.add(new Excel_tilte("地方自筹",4,4,12,12));
				et.add(new Excel_tilte("小计",4,4,13,13));
				et.add(new Excel_tilte("车购税",4,4,14,14));
				et.add(new Excel_tilte("燃油税",4,4,15,15));
				et.add(new Excel_tilte("厅统筹",4,4,16,16));
				et.add(new Excel_tilte("地方自筹",4,4,17,17));
				et.add(new Excel_tilte("小计",4,4,18,18));
				et.add(new Excel_tilte("车购税",4,4,19,19));
				et.add(new Excel_tilte("燃油税",4,4,20,20));
				et.add(new Excel_tilte("厅统筹",4,4,21,21));
				et.add(new Excel_tilte("地方自筹",4,4,22,22));
				et.add(new Excel_tilte("小计",4,4,23,23));
				et.add(new Excel_tilte("车购税",4,4,24,24));
				et.add(new Excel_tilte("燃油税",4,4,25,25));
				et.add(new Excel_tilte("厅统筹",4,4,26,26));
				et.add(new Excel_tilte("地方自筹",4,4,27,27));

				eldata.setEl(list);//将实体list放入类中

				eldata.setEt(et);//将表头内容设置到类里面
				HttpServletResponse response= getresponse();//获得一个HttpServletResponse
				Excel_export.excel_export(eldata,response);
			} else {
				List<Excel_list> l = tjbbServer.getJhzxqkb(elist);
				getRequest().getSession().setAttribute("zxqkblist", l);
				if(l.size()>1000)
					JsonUtils.write(l.subList(0, 1000), getresponse().getWriter());
				else
					JsonUtils.write(l, getresponse().getWriter());
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}


	public void getSbzjjhhzb(){
		try {
			elist.setDwdm(MyUtil.getQueryDwTJ(elist.getGydw(), "sb.dwdm"));
			elist.setXmnf(MyUtil.getQueryTJ(elist.getXmnf(), "t.xmnf"));
			elist.setXmmc(MyUtil.getQueryTJIN(elist.getXmmc(), "t.xmmc"));
			elist.setXmlx(MyUtil.getQueryTJIN(elist.getXmlx(), "tm.xmlx"));

//			elist.setXmlx(MyUtil.getQueryxmlxTJ(elist.getXmlx(), "xm.jsxz","xm.gcfl"));
//			elist.setXzqhdm(MyUtil.getQueryTJ(elist.getXzqhdm(), "xm.xzqhdm"));
//			elist.setTsdq(MyUtil.getQueryTJ(elist.getTsdq() ,"tsdq"));

			if ("1".equals(elist.getFlag())) {
				ExcelData eldata=new ExcelData();//创建一个类
				eldata.setTitleName("省补资金计划汇总表(按项目类型统计)");//设置第一行
				eldata.setSheetName("sheet1");//设置sheeet名
				eldata.setFileName("省补资金计划汇总表(按项目类型统计)");//设置文件名

				List<Excel_tilte> et=new ArrayList<Excel_tilte>();//创建一个list存放表头
				List<Excel_list> list=new ArrayList<Excel_list>();
				HttpServletRequest request = ServletActionContext.getRequest();
				HttpSession session = request.getSession();
				list=(List<Excel_list>) session.getAttribute("sbzjjhhzblist");

				et.add(new Excel_tilte("序号",1,1,0,0));
				et.add(new Excel_tilte("项目名称",1,1,1,1));
				et.add(new Excel_tilte("项目类型",1,1,2,2));
				et.add(new Excel_tilte("单位名称",1,1,3,3));

				et.add(new Excel_tilte("计划金额",1,1,4,4));
				et.add(new Excel_tilte("本年度请款金额",1,1,5,5));
				et.add(new Excel_tilte("累计请款金额",1,1,6,6));
				et.add(new Excel_tilte("未请款金额",1,1,7,7));

				eldata.setEl(list);//将实体list放入类中

				eldata.setEt(et);//将表头内容设置到类里面
				HttpServletResponse response= getresponse();//获得一个HttpServletResponse
				Excel_export.excel_export(eldata,response);

			} else {
				List<Excel_list> l = tjbbServer.getSbzjjhhzb(elist);
				getRequest().getSession().setAttribute("sbzjjhhzblist", l);
				if(l.size()>1000)
					JsonUtils.write(l.subList(0, 1000), getresponse().getWriter());
				else
					JsonUtils.write(l, getresponse().getWriter());
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}


	public void getPtglxmzjxqqkb(){
		try {
			elist.setXmlx(MyUtil.getQueryxmlxTJ(elist.getXmlx(), "xm.jsxz","xm.gcfl"));
//			elist.setJhxdwh(MyUtil.getQueryTJIN(elist.getJhxdwh(), "jhxdwh"));
			elist.setXzqhdm(MyUtil.getQueryTJ(elist.getXzqhdm(), "xm.xzqhdm"));
//			elist.setXmnf(MyUtil.getQueryTJ(elist.getJhnf(), "xdnf"));
			elist.setXmnf("");
			elist.setJhnf(MyUtil.getQueryTJ(elist.getJhnf(), "xd.jhxdwh"));
			elist.setGydwdm(MyUtil.getQueryDwTJ(elist.getGydw(), "xm.gydwdm"));
//			elist.setTsdq(MyUtil.getQueryTJ(elist.getTsdq() ,"tsdq"));
			System.out.println("============="+elist.getBbsj());
			if ("1".equals(elist.getFlag())) {
				ExcelData eldata=new ExcelData();//创建一个类
				eldata.setTitleName("普通公路项目资金需求情况表");//设置第一行
				eldata.setSheetName("sheet1");//设置sheeet名
				eldata.setFileName("普通公路项目资金需求情况表");//设置文件名

				List<Excel_tilte> et=new ArrayList<Excel_tilte>();//创建一个list存放表头
				List<Excel_list> list=new ArrayList<Excel_list>();
				HttpServletRequest request = ServletActionContext.getRequest();
				HttpSession session = request.getSession();
				String username = (String)session.getAttribute("truename");
				list=(List<Excel_list>) session.getAttribute("ptglxmzjxqqkblist");
				et.add(new Excel_tilte("填报单位：",1,1,0,0));
				et.add(new Excel_tilte("",1,1,1,6));
				et.add(new Excel_tilte("截止时间：",1,1,7,7));

				et.add(new Excel_tilte(elist.getBbsj(),1,1,8,9));
				et.add(new Excel_tilte("",1,1,10,13));
				et.add(new Excel_tilte("单位：万元",1,1,14,14));

				et.add(new Excel_tilte("计划文号",2,3,0,0));
				et.add(new Excel_tilte("项目总投资",2,2,1,5));
				et.add(new Excel_tilte("项目车购税、省级实际投入",2,2,6,9));
				et.add(new Excel_tilte("项目车购税、省级投入尚未到位资金",2,2,10,13));
				et.add(new Excel_tilte("备注",2,3,14,14));


				et.add(new Excel_tilte("小计",3,3,1,1));
				et.add(new Excel_tilte("车购税",3,3,2,2));
				et.add(new Excel_tilte("省补计划",3,3,3,3));
				et.add(new Excel_tilte("公投投入",3,3,4,4));
				et.add(new Excel_tilte("地方投入",3,3,5,5));

				et.add(new Excel_tilte("小计",3,3,6,6));
				et.add(new Excel_tilte("车购税",3,3,7,7));
				et.add(new Excel_tilte("省补计划",3,3,8,8));
				et.add(new Excel_tilte("公投投入",3,3,9,9));


				et.add(new Excel_tilte("小计",3,3,10,10));
				et.add(new Excel_tilte("车购税",3,3,11,11));
				et.add(new Excel_tilte("省补计划",3,3,12,12));
				et.add(new Excel_tilte("公投投入",3,3,13,13));

				eldata.setEl(list);//将实体list放入类中

				eldata.setEt(et);//将表头内容设置到类里面
				HttpServletResponse response= getresponse();//获得一个HttpServletResponse
				Excel_export.excel_export(eldata,response);

			} else {
				List<Excel_list> l = tjbbServer.getPtglxmzjxqqkb(elist);
				getRequest().getSession().setAttribute("ptglxmzjxqqkblist", l);
				if(l.size()>1000)
					JsonUtils.write(l.subList(0, 1000), getresponse().getWriter());
				else
					JsonUtils.write(l, getresponse().getWriter());
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public void getZjxdzjdwzjbfSum(){
		try {
			elist.setXzqhdm(MyUtil.getQueryTJ(elist.getXzqhdm(), "xzqhdm"));
			elist.setGydwdm(MyUtil.getQueryDwTJ(elist.getGydw(), "gydwdm"));
			elist.setJhxdwh(MyUtil.getQueryTJIN(elist.getJhxdwh(), "v_0"));
			elist.setJhnf(MyUtil.getQueryTJ(elist.getJhnf(), "xdnf"));
			String ny = "";
			elist.setNy(elist.getBbsj());
			if ("".equals(elist.getBbsj())) {
				ny = new Date().getYear()+"-"+new Date().getMonth();
			} else {
				ny = elist.getBbsj().substring(0, 7);
			}
			elist.setBbsj(ny);
			Excel_list data = tjbbServer.getZjxdzjdwzjbfSum(elist);
			JsonUtils.write(data, getresponse().getWriter());
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public void getZjxdzjdwzjbf(){
		List<Excel_list> list = null;
		try {
			elist.setXzqhdm(MyUtil.getQueryTJ(elist.getXzqhdm(), "xzqhdm"));
			elist.setGydwdm(MyUtil.getQueryDwTJ(elist.getGydw(), "gydwdm"));
			elist.setJhxdwh(MyUtil.getQueryTJIN(elist.getJhxdwh(), "v_0"));
			elist.setJhnf(MyUtil.getQueryXmnf(elist.getJhnf(), "xdnf"));
			String ny = "";
			elist.setNy(elist.getBbsj());
			if ("".equals(elist.getBbsj())) {
				ny = new Date().getYear()+"-"+new Date().getMonth();
			} else {
				ny = elist.getBbsj().substring(0, 7);
			}
			elist.setBbsj(ny);
			if ("1".equals(elist.getFlag())) {
				ExcelData eldata=new ExcelData();
				eldata.setTitleName("普通公路资金情况明细表（按文号）");
				eldata.setSheetName("普通公路资金情况明细表（按文号）");
				eldata.setFileName("普通公路资金情况明细表（按文号）");
				List<Excel_tilte> et=new ArrayList<Excel_tilte>();
				list = tjbbServer.exportZjxdzjdwzjbf(elist);
				et.add(new Excel_tilte("计划下达文号",1,2,0,0));
				et.add(new Excel_tilte("管养单位",1,2,1,1));
				et.add(new Excel_tilte("项目名称",1,2,2,2));
				et.add(new Excel_tilte("项目状态",1,2,18,18));
				et.add(new Excel_tilte("项目类型",1,2,19,19));
				et.add(new Excel_tilte("工程分类",1,2,20,20));
				et.add(new Excel_tilte("下达计划情况",1,1,3,7));
				et.add(new Excel_tilte("资金到位情况",1,1,8,12));
				et.add(new Excel_tilte("资金拨付情况",1,1,13,17));
				et.add(new Excel_tilte("小计",2,2,3,3));
				et.add(new Excel_tilte("车购税",2,2,4,4));
				et.add(new Excel_tilte("燃油税",2,2,5,5));
				et.add(new Excel_tilte("厅统筹",2,2,6,6));
				et.add(new Excel_tilte("地方自筹",2,2,7,7));
				et.add(new Excel_tilte("小计",2,2,8,8));
				et.add(new Excel_tilte("车购税",2,2,9,9));
				et.add(new Excel_tilte("燃油税",2,2,10,10));
				et.add(new Excel_tilte("厅统筹",2,2,11,11));
				et.add(new Excel_tilte("地方自筹",2,2,12,12));
				et.add(new Excel_tilte("小计",2,2,13,13));
				et.add(new Excel_tilte("车购税",2,2,14,14));
				et.add(new Excel_tilte("燃油税",2,2,15,15));
				et.add(new Excel_tilte("厅统筹",2,2,16,16));
				et.add(new Excel_tilte("地方自筹",2,2,17,17));

				eldata.setEl(list);
				eldata.setEt(et);//将表头内容设置到类里面
				HttpServletResponse response= getresponse();
				Excel_export.excel_export(eldata,response);
			} else {
				list = tjbbServer.getZjxdzjdwzjbf(elist);
				int count = tjbbServer.getZjxdzjdwzjbfCount(elist);
				EasyUIPage<Excel_list> eui = new EasyUIPage<Excel_list>();
				eui.setRows(list);
				eui.setTotal(count);
				JsonUtils.write(eui, getresponse().getWriter());
			}
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			if (list != null) {
				list = null;
			}
		}
	}

	public void getPtglxmssjzjdwqk(){
		try {
			elist.setXmlx(MyUtil.getQueryxmlxTJ(elist.getXmlx(), "xm.jsxz","xm.gcfl"));
//			elist.setJhxdwh(MyUtil.getQueryTJIN(elist.getJhxdwh(), "jhxdwh"));
			elist.setXzqhdm(MyUtil.getQueryTJ(elist.getXzqhdm(), "xm.xzqhdm"));
//			elist.setXmnf(MyUtil.getQueryTJ(elist.getJhnf(), "xdnf"));
			elist.setXmnf("");
			elist.setJhnf(MyUtil.getQueryTJ(elist.getJhnf(), "xd.jhxdwh"));
			elist.setGydwdm(MyUtil.getQueryDwTJ(elist.getGydw(), "xm.gydwdm"));
//			elist.setTsdq(MyUtil.getQueryTJ(elist.getTsdq() ,"tsdq"));
			if ("1".equals(elist.getFlag())) {
				ExcelData eldata=new ExcelData();//创建一个类
				eldata.setTitleName("普通公路项目实施及资金到位情况表");//设置第一行
				eldata.setSheetName("sheet1");//设置sheeet名
				eldata.setFileName("普通公路项目实施及资金到位情况表");//设置文件名

				List<Excel_tilte> et=new ArrayList<Excel_tilte>();//创建一个list存放表头
				List<Excel_list> list=new ArrayList<Excel_list>();
				HttpServletRequest request = ServletActionContext.getRequest();
				HttpSession session = request.getSession();
				String username = (String)session.getAttribute("truename");
				list=(List<Excel_list>) session.getAttribute("getPtglxmssjzjdwqk");
				et.add(new Excel_tilte("填报单位：",1,1,0,0));
				et.add(new Excel_tilte("",1,1,1,6));
				et.add(new Excel_tilte("截止时间：",1,1,7,7));

				et.add(new Excel_tilte(elist.getBbsj(),1,1,8,9));
				et.add(new Excel_tilte("",1,1,10,12));
				et.add(new Excel_tilte("单位：万元",1,1,13,13));

				et.add(new Excel_tilte("项目单位",2,3,0,0));
				et.add(new Excel_tilte("项目总投资",2,2,1,4));
				et.add(new Excel_tilte("部、省级投入计划金额",2,2,5,8));
				et.add(new Excel_tilte("部、省级投入到位金额",2,2,9,12));
				et.add(new Excel_tilte("备注",2,3,13,13));


				et.add(new Excel_tilte("小计",3,3,1,1));
				et.add(new Excel_tilte("车购税",3,3,2,2));
				et.add(new Excel_tilte("省补计划",3,3,3,3));
				et.add(new Excel_tilte("公投投入",3,3,4,4));
				et.add(new Excel_tilte("小计",3,3,5,5));

				et.add(new Excel_tilte("车购税",3,3,6,6));
				et.add(new Excel_tilte("省补计划",3,3,7,7));
				et.add(new Excel_tilte("公投投入",3,3,8,8));
				et.add(new Excel_tilte("小计",3,3,9,9));


				et.add(new Excel_tilte("车购税",3,3,10,10));
				et.add(new Excel_tilte("省补计划",3,3,11,11));
				et.add(new Excel_tilte("公投投入",3,3,12,12));

				eldata.setEl(list);//将实体list放入类中

				eldata.setEt(et);//将表头内容设置到类里面
				HttpServletResponse response= getresponse();//获得一个HttpServletResponse
				Excel_export.excel_export(eldata,response);

			} else {
				List<Excel_list> l = tjbbServer.getPtglxmssjzjdwqk(elist);
				getRequest().getSession().setAttribute("getPtglxmssjzjdwqk", l);
				if(l.size()>1000)
					JsonUtils.write(l.subList(0, 1000), getresponse().getWriter());
				else
					JsonUtils.write(l, getresponse().getWriter());
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public void qsptglxmsbcgsjczjqkb(){
		try {
//			elist.setXmlx(MyUtil.getQueryxmlxTJ(elist.getXmlx(), "xm.jsxz","xm.gcfl"));
//			elist.setXzqhdm(MyUtil.getQueryTJ(elist.getXzqhdm(), "xm.xzqhdm"));
//			elist.setXmnf("");
			elist.setXmnf(MyUtil.getQueryTJ(elist.getJhnf(), "x.xdnf"));
//			elist.setGydwdm(MyUtil.getQueryDwTJ(elist.getGydw(), "xm.gydwdm"));
			if ("1".equals(elist.getFlag())) {
				ExcelData eldata=new ExcelData();//创建一个类
				eldata.setTitleName("全省普通公路项目省补、车购税结存资金情况单位统计表");//设置第一行
				eldata.setSheetName("汇总表");//设置sheeet名
				eldata.setFileName("全省普通公路项目省补、车购税结存资金情况单位统计表");//设置文件名

				List<Excel_tilte> et=new ArrayList<Excel_tilte>();//创建一个list存放表头
				List<Excel_list> list=new ArrayList<Excel_list>();
				HttpServletRequest request = ServletActionContext.getRequest();
				HttpSession session = request.getSession();
				String username = (String)session.getAttribute("truename");
				list=(List<Excel_list>) session.getAttribute("qsptglxmsbcgsjczjqkb");

				String currYear = TimeUtil.getTime().substring(0,4);
				String currYearTo1 = String.valueOf(Integer.valueOf(currYear) -1);
				String currYearTo2 = String.valueOf(Integer.valueOf(currYearTo1) -1);

				et.add(new Excel_tilte("地级市：",1,3,0,0));
				et.add(new Excel_tilte("合计",1,3,1,1));
				et.add(new Excel_tilte("车购税小计：",1,3,2,2));
				et.add(new Excel_tilte("省补小计：",1,3,3,3));

				et.add(new Excel_tilte("项目状态",1,1,4,9));
				et.add(new Excel_tilte("计划年度",1,1,10,15));


				et.add(new Excel_tilte("在建",2,2,4,5));
				et.add(new Excel_tilte("已竣（完）工",2,2,6,7));
				et.add(new Excel_tilte("未开工",2,2,8,9));

				et.add(new Excel_tilte(currYearTo2+"年及以前",2,2,10,11));
				et.add(new Excel_tilte(currYearTo1+"年",2,2,12,13));//动态年份
				et.add(new Excel_tilte(currYear+"年",2,2,14,15));

				et.add(new Excel_tilte("车购税",3,3,4,4));
				et.add(new Excel_tilte("省补",3,3,5,5));

				et.add(new Excel_tilte("车购税",3,3,6,6));
				et.add(new Excel_tilte("省补",3,3,7,7));

				et.add(new Excel_tilte("车购税",3,3,8,8));
				et.add(new Excel_tilte("省补",3,3,9,9));


				et.add(new Excel_tilte("车购税",3,3,10,10));
				et.add(new Excel_tilte("省补",3,3,11,11));

				et.add(new Excel_tilte("车购税",3,3,12,12));
				et.add(new Excel_tilte("省补",3,3,13,13));

				et.add(new Excel_tilte("车购税",3,3,14,14));
				et.add(new Excel_tilte("省补",3,3,15,15));

				eldata.setEl(list);//将实体list放入类中

				eldata.setEt(et);//将表头内容设置到类里面
				HttpServletResponse response= getresponse();//获得一个HttpServletResponse
				Excel_export.excel_export(eldata,response);

			} else {
				List<Excel_list> l = new ArrayList<Excel_list>();
				if("2".equals(elist.getFlag())){//2是固化查询


					l= tjbbServer.qsptglxmsbcgsjczjqkbGhcx(elist);
				}else{//为0是非固化的正常查询
					l= tjbbServer.qsptglxmsbcgsjczjqkb(elist);
				}

				getRequest().getSession().setAttribute("qsptglxmsbcgsjczjqkb", l);
				if(l.size()>1000)
					JsonUtils.write(l.subList(0, 1000), getresponse().getWriter());
				else
					JsonUtils.write(l, getresponse().getWriter());
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}


	public void qsptglxmsbcgsjczjqkxmtjb(){
		try {
//			elist.setXmlx(MyUtil.getQueryxmlxTJ(elist.getXmlx(), "xm.jsxz","xm.gcfl"));
//			elist.setXzqhdm(MyUtil.getQueryTJ(elist.getXzqhdm(), "xm.xzqhdm"));
//			elist.setXmnf("");
			elist.setXmnf(MyUtil.getQueryTJ(elist.getJhnf(), "x.xdnf"));
			elist.setGydwdm(MyUtil.getQueryDwTJ(elist.getGydw(), "x.gydwdm"));
//			elist.setGydwdm(MyUtil.getQueryDwTJ(elist.getGydw(), "xm.gydwdm"));
			if ("1".equals(elist.getFlag())) {
				ExcelData eldata=new ExcelData();//创建一个类
				eldata.setTitleName("全省普通公路项目省补、车购税结存资金情况项目统计表");//设置第一行
				eldata.setSheetName("汇总表");//设置sheeet名
				eldata.setFileName("全省普通公路项目省补、车购税结存资金情况项目统计表");//设置文件名

				List<Excel_tilte> et=new ArrayList<Excel_tilte>();//创建一个list存放表头
				List<Excel_list> list=new ArrayList<Excel_list>();
				HttpServletRequest request = ServletActionContext.getRequest();
				HttpSession session = request.getSession();
				String username = (String)session.getAttribute("truename");
				list=(List<Excel_list>) session.getAttribute("qsptglxmsbcgsjczjqkxmtjb");

				String currYear = TimeUtil.getTime().substring(0,4);
				String currYearTo1 = String.valueOf(Integer.valueOf(currYear) -1);
				String currYearTo2 = String.valueOf(Integer.valueOf(currYearTo1) -1);

				et.add(new Excel_tilte("项目单位：",1,3,0,0));
				et.add(new Excel_tilte("按资金结存年度分",1,2,1,4));
				et.add(new Excel_tilte("按资金来源分：",1,1,5,13));

				et.add(new Excel_tilte("合计：",2,3,5,5));
				et.add(new Excel_tilte("厅统筹结存情况",2,2,6,9));
				et.add(new Excel_tilte("车购税结存情况",2,2,10,13));

				et.add(new Excel_tilte("小计",3,3,1,1));
				et.add(new Excel_tilte(currYearTo2+"年及以前",3,3,2,2));
				et.add(new Excel_tilte(currYearTo1+"年",3,3,3,3));
				et.add(new Excel_tilte(currYear+"年",3,3,4,4));
				et.add(new Excel_tilte("小计",3,3,6,6));
				et.add(new Excel_tilte(currYearTo2+"年及以前",3,3,7,7));
				et.add(new Excel_tilte(currYearTo1+"年",3,3,8,8));
				et.add(new Excel_tilte(currYear+"年",3,3,9,9));
				et.add(new Excel_tilte("小计",3,3,10,10));
				et.add(new Excel_tilte(currYearTo2+"年及以前",3,3,11,11));
				et.add(new Excel_tilte(currYearTo1+"年",3,3,12,12));
				et.add(new Excel_tilte(currYear+"年",3,3,13,13));

				eldata.setEl(list);//将实体list放入类中

				eldata.setEt(et);//将表头内容设置到类里面
				HttpServletResponse response= getresponse();//获得一个HttpServletResponse
				Excel_export.excel_export(eldata,response);

			} else {
				List<Excel_list> l = new ArrayList<Excel_list>();
				if("2".equals(elist.getFlag())){//2是固化查询


					l= tjbbServer.qsptglxmsbcgsjczjqkXmtjbGhcx(elist);
				}else{//为0是非固化的正常查询
					l= tjbbServer.qsptglxmsbcgsjczjqkxmtjb(elist);
				}

				getRequest().getSession().setAttribute("qsptglxmsbcgsjczjqkxmtjb", l);
				if(l.size()>1000)
					JsonUtils.write(l.subList(0, 1000), getresponse().getWriter());
				else
					JsonUtils.write(l, getresponse().getWriter());
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	//台帐汇总表
	public void getTzhzb(){
		try {
			if ("1".equals(elist.getFlag())) {
				ExcelData eldata=new ExcelData();//创建一个类
				eldata.setTitleName("台帐汇总表");//设置第一行
				eldata.setSheetName("sheet1");//设置sheeet名
				eldata.setFileName("台帐汇总表");//设置文件名

				List<Excel_tilte> et=new ArrayList<Excel_tilte>();//创建一个list存放表头
				List<Excel_list> list=new ArrayList<Excel_list>();
				HttpServletRequest request = ServletActionContext.getRequest();
				HttpSession session = request.getSession();
				String username = (String)session.getAttribute("truename");
				elist.setName((String) session.getAttribute("nameValue"));
				list=tjbbServer.getZdyBbzd(elist);

				String col=(String) session.getAttribute("colValue");

				elist.setXmlx(MyUtil.getQueryxmlxTJ(elist.getXmlx(), "xm.jsxz","xm.gcfl"));

				elist.setJhxdwh(MyUtil.getQueryTJIN((String)session.getAttribute("sql"), "xd.jhxdwh"));
				elist.setXzqhdm(MyUtil.getQueryTJ((String)session.getAttribute("xzqhbb"), "xm.xzqhdm"));


				List<Excel_list> list1 = (List<Excel_list>) getRequest().getSession().getAttribute("tzhzb");

				//以上代码就是为了获取SQL语句的查询结果，并且封装到了一个实体里面。以下的这一段代码是在拼接表头。

				int rowxh=0,col1=0,col2=0;
				int colint=0;
				int a[][]=new int[4][85];
				int flag=0;
				for(int i=0;i<list.size();i++){
					if(rowxh!=Integer.parseInt(list.get(i).getRowxh())-1){
						rowxh=Integer.parseInt(list.get(i).getRowxh())-1;
						col1=colint;
						flag=0;
					}
					if(list.get(i).getValue().indexOf("1v_")!=-1||list.get(i).getValue().indexOf("5v_")!=-1){
						list.get(i).setRow1(Integer.parseInt(list.get(i).getRowxh())-1);
						list.get(i).setRow2(Integer.parseInt(list.get(i).getRowxh())-1+Integer.parseInt(list.get(i).getHight()));
					}else{
						list.get(i).setRow1(Integer.parseInt(list.get(i).getRowxh())-1);
						list.get(i).setRow2(Integer.parseInt(list.get(i).getRowxh())-1+Integer.parseInt(list.get(i).getHight())-1);
					}


					while(a[rowxh][col1]!=0){
						col1=col1+a[rowxh][col1];
					}

					if(Integer.parseInt(list.get(i).getHight())!=1){
						for(int j=1;j<Integer.parseInt(list.get(i).getHight());j++){
							a[rowxh+j][col1]=Integer.parseInt(list.get(i).getCo());
						}
					}else{
						if(flag==0){
							colint=col1;
							flag=1;
						}
					}


					list.get(i).setCol1(col1);
					col2=col1+Integer.parseInt(list.get(i).getCo())-1;
					list.get(i).setCol2(col2);
					col1=col1+Integer.parseInt(list.get(i).getCo());
				}

				et.add(new Excel_tilte("填报单位：",1,1,0,0));
				et.add(new Excel_tilte(username,1,1,1,1));
				et.add(new Excel_tilte("",1,1,2,6));
				et.add(new Excel_tilte("数据统计截止时间：",1,1,7,7));

				et.add(new Excel_tilte(elist.getBbsj(),1,1,8,8));
				et.add(new Excel_tilte("",1,1,9,15));
				et.add(new Excel_tilte("单位：万元",1,1,16,17));

				for (Excel_list ex : list) {
					et.add(new Excel_tilte(ex.getName(),ex.getRow1()+2,ex.getRow2()+2,ex.getCol1(),ex.getCol2()));
				}


				String[] ls=col.split(",");
				List<Excel_list> elst=new ArrayList<Excel_list>();

				for (Excel_list els : list1) {
					Excel_list els1=new Excel_list();
					for (int i = 0; i < ls.length; i++) {

						Field field1 = null; Field field2 = null;
						field1 = els1.getClass().getDeclaredField("v_"+i);
						field2 = els.getClass().getDeclaredField(ls[i]);
						field1.set((Object) els1, field2.get(els));  //set方法

					}
					elst.add(els1);
				}
				eldata.setEl(elst);//将实体list放入类中

				eldata.setEt(et);//将表头内容设置到类里面
				HttpServletResponse response= getresponse();//获得一个HttpServletResponse
				Excel_export.excel_export(eldata,response);

			} else {
				elist.setXmlx(MyUtil.getQueryxmlxTJ(elist.getXmlx(), "xm.jsxz","xm.gcfl"));
				elist.setJhxdwh(MyUtil.getQueryTJIN(elist.getJhxdwh(), "xd.jhxdwh"));
				elist.setXzqhdm(MyUtil.getQueryTJ(elist.getXzqhdm(), "xm.xzqhdm"));
				elist.setGydwdm(MyUtil.getQueryDwTJ(elist.getGydwdm(), "xm.gydwdm"));
				elist.setXmnf(MyUtil.getQueryTJ(elist.getXmnf(), "xd.jhxdwh"));
				List<Excel_list> l = tjbbServer.getTzhzb(elist);
				getRequest().getSession().setAttribute("tzhzb", l);
				if(l.size()>1000)
					JsonUtils.write(l.subList(0, 1000), getresponse().getWriter());
				else
					JsonUtils.write(l, getresponse().getWriter());
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public void queryXmlist(){
		xmjbxx.setGydwdm(MyUtil.getQueryDwTJ(xmjbxx.getGydwdm(), "t.gydwdm"));
		xmjbxx.setXzqh(MyUtil.getQueryTJ(xmjbxx.getXzqh(), "xzqhdm"));
		xmjbxx.setXmnf(MyUtil.getQueryTJ(xmjbxx.getXmnf(), "xmnf"));
		xmjbxx.setJsxz(MyUtil.getQueryTJ(xmjbxx.getJsxz(), "jsxz||gcfl"));
		xmjbxx.setJhxdwh(MyUtil.getQueryTJIN(xmjbxx.getJhxdwh(), "jhxdwh"));
		xmjbxx.setGcfl(MyUtil.getQueryTJ(xmjbxx.getGcfl(), "gcfl"));
		xmjbxx.setShzt(MyUtil.getQueryTJ(xmjbxx.getShzt(), "shztstr"));
		xmjbxx.setSsbzt(MyUtil.getQueryTJ(xmjbxx.getSsbzt(), "ssbztstr"));
		xmjbxx.setXsbzt(MyUtil.getQueryTJ(xmjbxx.getXsbzt(), "xsbztstr"));
		xmjbxx.setPage(page);
		xmjbxx.setRows(rows);


		List<Xmjbxx> list=tjbbServer.queryXmlist(xmjbxx);
		int count=tjbbServer.queryXmlistCount(xmjbxx);
		EasyUIPage<Xmjbxx> e=new EasyUIPage<Xmjbxx>();
		e.setRows(list);
		e.setTotal(count);
		try {
			JsonUtils.write(e, getresponse().getWriter());
		} catch (Exception e1) {
			e1.printStackTrace();
		}

	}

	//台帐明细表
	public void getTzmxb(){
		try {
			List<Excel_list> l=tjbbServer.getTzmxbbt(elist);
			if("1".equals(elist.getFlag())){

				ExcelData eldata=new ExcelData();//创建一个类
				eldata.setTitleName("台帐明细表");//设置第一行
				eldata.setSheetName("sheet1");//设置sheeet名
				eldata.setFileName("台帐明细表");//设置文件名

				List<Excel_tilte> et=new ArrayList<Excel_tilte>();//创建一个list存放表头
				if(l.size()>0){
					String[] dw=new String[0];
					if(l.get(0).getDwbt()!=null&&!"".equals(l.get(0).getDwbt()))
						dw=l.get(0).getDwbt().split(",");
					String[] bf=new String[0];
					if(l.get(0).getBfbt()!=null&&!"".equals(l.get(0).getBfbt()))
						bf=l.get(0).getBfbt().split(",");

					et.add(new Excel_tilte("科目明细",1,2,0,1));
					et.add(new Excel_tilte("计划下达数",1,2,2,2));
					et.add(new Excel_tilte("截至上年收款",1,2,3,3));
					int k=3;
					if(dw.length>0){
						k=4;
						et.add(new Excel_tilte("本年收款明细",1,1,k,k+dw.length));
					}
					et.add(new Excel_tilte("截至上年拨款",1,2,k+dw.length+1,k+dw.length+1));
					if(bf.length>0){
						et.add(new Excel_tilte("本年拨付明细",1,1,k+dw.length+2,k+dw.length+bf.length+2));
					}else{
						k=3;
					}
					et.add(new Excel_tilte("累计收款",1,2,k+dw.length+bf.length+3,k+dw.length+bf.length+3));
					et.add(new Excel_tilte("累计拨款",1,2,k+dw.length+bf.length+4,k+dw.length+bf.length+4));
					et.add(new Excel_tilte("未收款数",1,2,k+dw.length+bf.length+5,k+dw.length+bf.length+5));
					et.add(new Excel_tilte("收款未拨数",1,2,k+dw.length+bf.length+6,k+dw.length+bf.length+6));
					et.add(new Excel_tilte("备注",1,2,k+dw.length+bf.length+7,k+dw.length+bf.length+7));
					for (int i = 0; i < dw.length; i++) {
						k=4;
						if(i==0){
							et.add(new Excel_tilte("小计",2,2,k,k));
							et.add(new Excel_tilte(dw[i],2,2,k+i+1,k+i+1));
						}
						else
							et.add(new Excel_tilte(dw[i],2,2,k+i+1,k+i+1));
					}
					for (int i = 0; i < bf.length; i++) {
						if(i==0){
							et.add(new Excel_tilte("小计",2,2,k+dw.length+2,k+dw.length+2));
							et.add(new Excel_tilte(bf[i],2,2,k+dw.length+i+3,k+dw.length+i+3));
						}
						else
							et.add(new Excel_tilte(bf[i],2,2,k+dw.length+i+3,k+dw.length+i+3));
					}

				}

				eldata.setEl(l);//将实体list放入类中
				eldata.setEt(et);//将表头内容设置到类里面
				HttpServletResponse response= getresponse();//获得一个HttpServletResponse
				Excel_export.excel_export(eldata,response);

			}
			else
				JsonUtils.write(l, getresponse().getWriter());
		} catch (Exception e1) {
			e1.printStackTrace();
		}
	}

	public void getGlzcqkb(){
		try {

			if("1".equals(elist.getFlag())){
				HttpServletRequest request = ServletActionContext.getRequest();
				HttpSession session = request.getSession();
//				System.out.println(elist.getNf());
				elist.setGydw(MyUtil.getQueryTJ((String) session.getAttribute("gydwbb"), "gydwdm"));
				List<Excel_list> l = tjbbServer.getGlzcqkb(elist);

				ExcelData eldata=new ExcelData();//创建一个类
				eldata.setTitleName("公路资产情况表");//设置第一行
				eldata.setSheetName("sheet1");//设置sheeet名
				eldata.setFileName("公路资产情况表");//设置文件名

				List<Excel_tilte> et=new ArrayList<Excel_tilte>();//创建一个list存放表头
				et.add(new Excel_tilte("项目",1,2,0,1));
				et.add(new Excel_tilte("数量单位",1,2,2,2));
				et.add(new Excel_tilte("行次",1,2,3,3));
				et.add(new Excel_tilte("数量",1,1,4,7));
				et.add(new Excel_tilte("资产（价值）",1,1,8,9));
				et.add(new Excel_tilte("其中：负债",1,1,10,11));
				et.add(new Excel_tilte("期初数",2,2,4,4));
				et.add(new Excel_tilte("增加数",2,2,5,5));
				et.add(new Excel_tilte("减少数",2,2,6,6));
				et.add(new Excel_tilte("期末数",2,2,7,7));
				et.add(new Excel_tilte("期初数",2,2,8,8));
				et.add(new Excel_tilte("期末数",2,2,9,9));
				et.add(new Excel_tilte("期初数",2,2,10,10));
				et.add(new Excel_tilte("期末数",2,2,11,11));
				et.add(new Excel_tilte("栏次",3,3,0,3));
				et.add(new Excel_tilte("1",3,3,4,4));
				et.add(new Excel_tilte("2",3,3,5,5));
				et.add(new Excel_tilte("3",3,3,6,6));
				et.add(new Excel_tilte("4",3,3,7,7));
				et.add(new Excel_tilte("5",3,3,8,8));
				et.add(new Excel_tilte("6",3,3,9,9));
				et.add(new Excel_tilte("7",3,3,10,10));
				et.add(new Excel_tilte("8",3,3,11,11));

				eldata.setEl(l);//将实体list放入类中
				eldata.setEt(et);//将表头内容设置到类里面
				HttpServletResponse response= getresponse();//获得一个HttpServletResponse
				Excel_export.excel_exportGlzcqkb(eldata,response);
			}else{
				elist.setGydw(MyUtil.getQueryDwTJ(elist.getGydw(), "gydwdm"));
				List<Excel_list> l = tjbbServer.getGlzcqkb(elist);
				JsonUtils.write(l, getresponse().getWriter());
			}

		} catch (Exception e) {
			e.printStackTrace();
		}



	}


	//导入用友报表
	public void importTjbb() {

		System.out.println("进入方法");
		String fileType=fileuploadFileName.substring(fileuploadFileName.length()-3, fileuploadFileName.length());
		HttpServletResponse response = getresponse();
		try{
			if(!"xls".equals(fileType)&&!"xlsx".equals(fileType)){
				response.getWriter().print(fileuploadFileName+"不是系统导出的excel模版文件");
				return ;
			}
			response.setCharacterEncoding("utf-8");
			FileInputStream fs = new FileInputStream(this.fileupload);
			List<Map>[] dataMapArray;
			try{
				dataMapArray = ExcelReader.readExcelContent(0,20,fs,Object.class);
			}catch(Exception e){
				response.getWriter().print(fileuploadFileName+"数据有误");
				return;
			}
			//System.out.println(dataMapArray[0]);
			List<Map> data = ExcelReader.removeBlankRow(dataMapArray[0]);

			if(data.size()>=1) {
				//验证()
				if("bzsrzcb".equals(elist.getXmlx())) {
					if(data.get(3).get("0").equals("项目")&&data.get(3).get("1").equals("本年数")&&data.get(3).get("2").equals("上年数")&&data.size()==51) {
						List<Map> rm =new ArrayList<Map>();
						rm.add(data.get(0));rm.add(data.get(1));rm.add(data.get(2));rm.add(data.get(3));
						data.removeAll(rm);
					}else {
						response.getWriter().print(fileuploadFileName+"数据有误");
						return;
					}
				}
				else if("bycbb".equals(elist.getXmlx())) {

					if(data.get(2).get("0").equals("项       目")&&data.get(2).get("1").equals("合   计")&&data.get(2).get("2").equals("国     道")&&data.size()==20) {
						List<Map> rm =new ArrayList<Map>();
						rm.add(data.get(0));rm.add(data.get(1));rm.add(data.get(2));rm.add(data.get(3));rm.add(data.get(4));
						data.removeAll(rm);
					}else {
						response.getWriter().print(fileuploadFileName+"数据有误");
						return;
					}

				}

				else if("zjbdb".equals(elist.getXmlx())) {
					if(data.get(3).get("0").equals("项目")&&data.get(3).get("1").equals("金额")&&data.get(3).get("2").equals("项目")&&data.size()==28) {
						List<Map> rm =new ArrayList<Map>();
						rm.add(data.get(0));rm.add(data.get(1));rm.add(data.get(2));rm.add(data.get(3));
						data.removeAll(rm);
					}else {
						response.getWriter().print(fileuploadFileName+"数据有误");
						return;
					}

				}

				else if("srzcb".equals(elist.getXmlx())) {
					for (Map map : data) {
						System.out.println(map);
					}
					System.out.println(data.size());
					if(data.get(3).get("0").equals("项目")&&data.get(3).get("1").equals("本月数")&&data.get(3).get("2").equals("本年累计数")&&data.size()==29) {
						List<Map> rm =new ArrayList<Map>();
						rm.add(data.get(0));rm.add(data.get(1));rm.add(data.get(2));rm.add(data.get(3));
						data.removeAll(rm);
					}else {
						response.getWriter().print(fileuploadFileName+"数据有误");
						return;
					}
				}
				else if("zxqkb".equals(elist.getXmlx())) {

					if(data.get(2).get("0").equals("项        目")&&data.get(2).get("1").equals("行次")&&data.get(2).get("2").equals("上年结转")&&data.size()==26) {
						List<Map> rm =new ArrayList<Map>();
						rm.add(data.get(0));rm.add(data.get(1));rm.add(data.get(2));rm.add(data.get(3));
						data.removeAll(rm);
					}else {
						response.getWriter().print(fileuploadFileName+"数据有误");
						return;
					}
				}
				else if("zcfzb".equals(elist.getXmlx())) {

					if(data.get(3).get("0").equals("资产")&&data.get(3).get("1").equals("期末余额")&&data.get(3).get("2").equals("年初余额")&&data.size()==33) {
						List<Map> rm =new ArrayList<Map>();
						rm.add(data.get(0));rm.add(data.get(1));rm.add(data.get(2));rm.add(data.get(3));
						data.removeAll(rm);
					}else {
						response.getWriter().print(fileuploadFileName+"数据有误");
						return;
					}
				}
				else {
					response.getWriter().print(fileuploadFileName+"数据有误");
					return;
				}
			}else {
				response.getWriter().print(fileuploadFileName+"数据有误");
				return;
			}
			//处理数据
			for (int i = 0; i < data.size(); i++) {
				HttpServletRequest request = getRequest();
				HttpSession session = request.getSession();
				//
				data.get(i).put("XH", i+1);
				data.get(i).put("XMLX", elist.getXmlx());
				data.get(i).put("GYDW", elist.getGydw());
				data.get(i).put("NF", (String) session.getAttribute("nf"));
				data.get(i).put("YF", (String) session.getAttribute("yf"));
				data.get(i).put("V_0", data.get(i).get("0").toString().trim());
				data.get(i).put("V_1", data.get(i).get("1").toString().trim());
				data.get(i).put("V_2", data.get(i).get("2").toString().trim());
				data.get(i).put("V_3", data.get(i).get("3").toString().trim());
				data.get(i).put("V_4", data.get(i).get("4").toString().trim());
				data.get(i).put("V_5", data.get(i).get("5").toString().trim());
				data.get(i).put("V_6", data.get(i).get("6").toString().trim());
				data.get(i).put("V_7", data.get(i).get("7").toString().trim());
				data.get(i).put("V_8", data.get(i).get("8").toString().trim());
				data.get(i).put("V_9", data.get(i).get("9").toString().trim());
				data.get(i).put("V_10", data.get(i).get("10").toString().trim());
				data.get(i).put("V_11", data.get(i).get("11").toString().trim());
				data.get(i).put("V_12", data.get(i).get("12").toString().trim());
				data.get(i).put("V_13", data.get(i).get("13").toString().trim());
				data.get(i).put("V_14", data.get(i).get("14").toString().trim());
				data.get(i).put("V_15", data.get(i).get("15").toString().trim());
				data.get(i).put("V_16", data.get(i).get("16").toString().trim());
				data.get(i).put("V_17", data.get(i).get("17").toString().trim());
				data.get(i).put("V_18", data.get(i).get("18").toString().trim());
				data.get(i).put("V_19", data.get(i).get("19").toString().trim());


			}

			//将数据插入到数据库
			boolean b=tjbbServer.importTjbb(data);
			if(b)
				response.getWriter().print(fileuploadFileName+"导入成功");
			else
				response.getWriter().print(fileuploadFileName+"导入失败");
		}catch(Exception e){
			e.printStackTrace();
		}


	}

	//固化版本
	public void addGhbbHx() throws IOException {
		HttpServletResponse response = getresponse();
		List<Excel_list> list=new ArrayList<Excel_list>();
		HttpServletRequest request = ServletActionContext.getRequest();
		HttpSession session = request.getSession();
		String username = (String)session.getAttribute("truename");
		list=(List<Excel_list>) session.getAttribute("qsptglxmsbcgsjczjqkb");

		int xh = 0;
		for (Excel_list excel_list : list) {
			excel_list.setXh(String.valueOf(xh++));
			excel_list.setGhny(elist.getNf()+"-"+elist.getYf());
		}

		//将数据插入到数据库
		boolean b=tjbbServer.addGhbbHx(list);
		ResponseUtils.write(getresponse(), b+"");

	}

	//固化版本
	public void addGhXmtjbbHx() throws IOException {
		HttpServletResponse response = getresponse();
		List<Excel_list> list=new ArrayList<Excel_list>();
		HttpServletRequest request = ServletActionContext.getRequest();
		HttpSession session = request.getSession();
		String username = (String)session.getAttribute("truename");
		list=(List<Excel_list>) session.getAttribute("qsptglxmsbcgsjczjqkxmtjb");

		int xh = 0;
		for (Excel_list excel_list : list) {
			excel_list.setXh(String.valueOf(xh++));
			excel_list.setGhny(elist.getNf()+"-"+elist.getYf());
		}

		//将数据插入到数据库
		boolean b=tjbbServer.addGhXmtjbbHx(list);
		ResponseUtils.write(getresponse(), b+"");

	}

	//查重
	public void selectGhbbCf() throws IOException {
		HttpServletResponse response = getresponse();

		boolean b=tjbbServer.selectGhbbCf(elist);
		ResponseUtils.write(getresponse(), b+"");

	}

	//查重
	public void selectGhbbXmtjCf() throws IOException {
		HttpServletResponse response = getresponse();

		boolean b=tjbbServer.selectGhbbXmtjCf(elist);
		ResponseUtils.write(getresponse(), b+"");

	}

	/**
	 * 删除
	 */
	public void deleteGhbbByghny(){
		boolean bl  = tjbbServer.deleteGhbbByghny(elist);
		if(bl == true){
			ResponseUtils.write(getresponse(), "true");
		}else{
			ResponseUtils.write(getresponse(), "false");
		}
	}

	/**
	 * 删除
	 */
	public void deleteGhXmtjbbByghny(){
		boolean bl  = tjbbServer.deleteGhXmtjbbByghny(elist);
		if(bl == true){
			ResponseUtils.write(getresponse(), "true");
		}else{
			ResponseUtils.write(getresponse(), "false");
		}
	}


	/**
	 * 查询用友报表
	 */
	public void getTjbb() {
		try {
			if("0".equals(elist.getFlag())){
				elist.setGydw(MyUtil.getQueryTJ(elist.getGydw(), "gydw"));
				elist.setYf(MyUtil.getQueryTJ(elist.getYf(), "yf"));
				List<Excel_list> list = tjbbServer.getTjbb(elist);
				if("bzsrzcb".equals(elist.getXmlx()))
					getRequest().getSession().setAttribute("bzsrzcb", list);
				else if("bycbb".equals(elist.getXmlx()))
					getRequest().getSession().setAttribute("bycbb", list);
				else if("zjbdb".equals(elist.getXmlx()))
					getRequest().getSession().setAttribute("zjbdb", list);
				else if("srzcb".equals(elist.getXmlx()))
					getRequest().getSession().setAttribute("srzcb", list);
				else if("zxqkb".equals(elist.getXmlx()))
					getRequest().getSession().setAttribute("zxqkb", list);
				else if("zcfzb".equals(elist.getXmlx()))
					getRequest().getSession().setAttribute("zcfzb", list);
				JsonUtils.write(list, getresponse().getWriter());
			}else{
				if("bzsrzcb".equals(elist.getXmlx())){
					HttpServletRequest request = ServletActionContext.getRequest();
					HttpSession session = request.getSession();
//					System.out.println(elist.getNf());
					List<Excel_list> l = (List<Excel_list>) session.getAttribute("bzsrzcb");
					ExcelData eldata=new ExcelData();//创建一个类
					eldata.setTitleName("财政补助收入支出表");//设置第一行
					eldata.setSheetName("sheet1");//设置sheeet名
					eldata.setFileName("财政补助收入支出表");//设置文件名

					List<Excel_tilte> ett=new ArrayList<Excel_tilte>();//创建一个list存放表头
					ett.add(new Excel_tilte("",1,1,0,0));
					ett.add(new Excel_tilte("",1,1,1,1));
					ett.add(new Excel_tilte("           会事业03表",1,1,2,2));
					ett.add(new Excel_tilte("编制单位:          ",2,2,0,0));
					ett.add(new Excel_tilte(elist.getNf()+"年度",2,2,1,1));
					ett.add(new Excel_tilte("              单位：元",2,2,2,2));
					List<Excel_tilte> et=new ArrayList<Excel_tilte>();//创建一个list存放表头
					et.add(new Excel_tilte("项目",3,3,0,0));
					et.add(new Excel_tilte("本年数",3,3,1,1));
					et.add(new Excel_tilte("上年数",3,3,2,2));
					eldata.setEl(l);//将实体list放入类中
					eldata.setEtt(ett);//将表头内容设置到类里面
					eldata.setEt(et);//将表头内容设置到类里面
					HttpServletResponse response= getresponse();//获得一个HttpServletResponse
					Excel_export.excel_exportyybb(eldata,response);
				}
				else if("bycbb".equals(elist.getXmlx())){
					HttpServletRequest request = ServletActionContext.getRequest();
					HttpSession session = request.getSession();
//					System.out.println(elist.getNf());
					List<Excel_list> l = (List<Excel_list>) session.getAttribute("bycbb");
					ExcelData eldata=new ExcelData();//创建一个类
					eldata.setTitleName("公路小修保养成本表");//设置第一行
					eldata.setSheetName("sheet1");//设置sheeet名
					eldata.setFileName("公路小修保养成本表");//设置文件名

					List<Excel_tilte> ett=new ArrayList<Excel_tilte>();//创建一个list存放表头
					ett.add(new Excel_tilte(" ",1,1,0,8));
					ett.add(new Excel_tilte("单位：元 ",1,1,9,9));
					ett.add(new Excel_tilte("",1,1,10,10));
					ett.add(new Excel_tilte("           会事业03表",1,1,11,11));

					List<Excel_tilte> et=new ArrayList<Excel_tilte>();//创建一个list存放表头
					et.add(new Excel_tilte("项目",2,3,0,0));
					et.add(new Excel_tilte("合 计",2,3,1,1));
					et.add(new Excel_tilte("国 道",2,2,2,6));
					et.add(new Excel_tilte("省 道",2,2,7,11));
					et.add(new Excel_tilte("里程",3,3,2,2));
					et.add(new Excel_tilte("小计",3,3,3,3));
					et.add(new Excel_tilte("砼路面",3,3,4,4));
					et.add(new Excel_tilte("沥青路面",3,3,5,5));
					et.add(new Excel_tilte("其他路面",3,3,6,6));
					et.add(new Excel_tilte("里程",3,3,7,7));
					et.add(new Excel_tilte("小计",3,3,8,8));
					et.add(new Excel_tilte("砼路面",3,3,9,9));
					et.add(new Excel_tilte("沥青路面",3,3,10,10));
					et.add(new Excel_tilte("其他路面",3,3,11,11));
					et.add(new Excel_tilte("行次",4,4,0,0));
					et.add(new Excel_tilte("1",4,4,1,1));
					et.add(new Excel_tilte("2",4,4,2,2));
					et.add(new Excel_tilte("3",4,4,3,3));
					et.add(new Excel_tilte("4",4,4,4,4));
					et.add(new Excel_tilte("5",4,4,5,5));
					et.add(new Excel_tilte("6",4,4,6,6));
					et.add(new Excel_tilte("7",4,4,7,7));
					et.add(new Excel_tilte("8",4,4,8,8));
					et.add(new Excel_tilte("9",4,4,9,9));
					et.add(new Excel_tilte("10",4,4,10,10));
					et.add(new Excel_tilte("11",4,4,11,11));

					eldata.setEl(l);//将实体list放入类中
					eldata.setEtt(ett);//将表头内容设置到类里面
					eldata.setEt(et);//将表头内容设置到类里面
					HttpServletResponse response= getresponse();//获得一个HttpServletResponse
					Excel_export.excel_exportyybb(eldata,response);
				}
				else if("zjbdb".equals(elist.getXmlx())){
					HttpServletRequest request = ServletActionContext.getRequest();
					HttpSession session = request.getSession();
//					System.out.println(elist.getNf());
					List<Excel_list> l = (List<Excel_list>) session.getAttribute("zjbdb");
					ExcelData eldata=new ExcelData();//创建一个类
					eldata.setTitleName("固定资产增减变动表");//设置第一行
					eldata.setSheetName("sheet1");//设置sheeet名
					eldata.setFileName("固定资产增减变动表");//设置文件名

					List<Excel_tilte> ett=new ArrayList<Excel_tilte>();//创建一个list存放表头
					ett.add(new Excel_tilte("",1,1,0,0));
					ett.add(new Excel_tilte("",1,1,1,1));
					ett.add(new Excel_tilte("",1,1,2,2));
					ett.add(new Excel_tilte("           养护事业06表",1,1,3,3));
					ett.add(new Excel_tilte("编制单位:          ",2,2,0,0));
					ett.add(new Excel_tilte("              年 月 日",2,2,1,1));
					ett.add(new Excel_tilte("",1,1,2,2));
					ett.add(new Excel_tilte("              金额单位:元",2,2,3,3));
					List<Excel_tilte> et=new ArrayList<Excel_tilte>();//创建一个list存放表头
					et.add(new Excel_tilte("项目",3,3,0,0));
					et.add(new Excel_tilte("金额",3,3,1,1));
					et.add(new Excel_tilte("项目",3,3,2,2));
					et.add(new Excel_tilte("金额",3,3,3,3));
					eldata.setEl(l);//将实体list放入类中
					eldata.setEtt(ett);//将表头内容设置到类里面
					eldata.setEt(et);//将表头内容设置到类里面
					HttpServletResponse response= getresponse();//获得一个HttpServletResponse
					Excel_export.excel_exportyybb(eldata,response);
				}
				else if("srzcb".equals(elist.getXmlx())){
					HttpServletRequest request = ServletActionContext.getRequest();
					HttpSession session = request.getSession();
//					System.out.println(elist.getNf());
					List<Excel_list> l = (List<Excel_list>) session.getAttribute("srzcb");
					ExcelData eldata=new ExcelData();//创建一个类
					eldata.setTitleName("收入支出表");//设置第一行
					eldata.setSheetName("sheet1");//设置sheeet名
					eldata.setFileName("收入支出表");//设置文件名

					List<Excel_tilte> ett=new ArrayList<Excel_tilte>();//创建一个list存放表头
					ett.add(new Excel_tilte("",1,1,0,0));
					ett.add(new Excel_tilte("",1,1,1,1));
					ett.add(new Excel_tilte("           会事业02表",1,1,2,2));
					ett.add(new Excel_tilte("编制单位:          ",2,2,0,0));
					ett.add(new Excel_tilte("              年 月 日",2,2,1,1));
					ett.add(new Excel_tilte("              金额单位:元",2,2,2,2));
					List<Excel_tilte> et=new ArrayList<Excel_tilte>();//创建一个list存放表头
					et.add(new Excel_tilte("项目",3,3,0,0));
					et.add(new Excel_tilte("本月数",3,3,1,1));
					et.add(new Excel_tilte("本年累计数",3,3,2,2));
					eldata.setEl(l);//将实体list放入类中
					eldata.setEtt(ett);//将表头内容设置到类里面
					eldata.setEt(et);//将表头内容设置到类里面
					HttpServletResponse response= getresponse();//获得一个HttpServletResponse
					Excel_export.excel_exportyybb(eldata,response);
				}
				else if("zxqkb".equals(elist.getXmlx())){
					HttpServletRequest request = ServletActionContext.getRequest();
					HttpSession session = request.getSession();
//					System.out.println(elist.getNf());
					List<Excel_list> l = (List<Excel_list>) session.getAttribute("zxqkb");
					ExcelData eldata=new ExcelData();//创建一个类
					eldata.setTitleName("养路支出预算执行情况表");//设置第一行
					eldata.setSheetName("sheet1");//设置sheeet名
					eldata.setFileName("养路支出预算执行情况表");//设置文件名

					List<Excel_tilte> ett=new ArrayList<Excel_tilte>();//创建一个list存放表头
					ett.add(new Excel_tilte("编制单位:          ",1,1,0,0));
					ett.add(new Excel_tilte("              养护事业04表",1,1,8,8));
					List<Excel_tilte> et=new ArrayList<Excel_tilte>();//创建一个list存放表头
					et.add(new Excel_tilte("项目",2,3,0,0));
					et.add(new Excel_tilte("行次",2,3,1,1));
					et.add(new Excel_tilte("上年结转",2,3,2,2));
					et.add(new Excel_tilte("本年预算数",2,2,3,6));
					et.add(new Excel_tilte("本年实际支出",2,3,7,7));
					et.add(new Excel_tilte("本年结转",2,3,8,8));
					et.add(new Excel_tilte("养路补助",3,3,3,3));
					et.add(new Excel_tilte("车购税补助",3,3,4,4));
					et.add(new Excel_tilte("其他来源",3,3,5,5));
					et.add(new Excel_tilte("合计",3,3,6,6));

					eldata.setEl(l);//将实体list放入类中
					eldata.setEtt(ett);//将表头内容设置到类里面
					eldata.setEt(et);//将表头内容设置到类里面
					HttpServletResponse response= getresponse();//获得一个HttpServletResponse
					Excel_export.excel_exportyybb(eldata,response);
				}
				else if("zcfzb".equals(elist.getXmlx())){
					HttpServletRequest request = ServletActionContext.getRequest();
					HttpSession session = request.getSession();
//					System.out.println(elist.getNf());
					List<Excel_list> l = (List<Excel_list>) session.getAttribute("zcfzb");
					ExcelData eldata=new ExcelData();//创建一个类
					eldata.setTitleName("资产负债表");//设置第一行
					eldata.setSheetName("sheet1");//设置sheeet名
					eldata.setFileName("资产负债表");//设置文件名

					List<Excel_tilte> ett=new ArrayList<Excel_tilte>();//创建一个list存放表头
					ett.add(new Excel_tilte("              会事业01表",1,1,5,5));
					ett.add(new Excel_tilte("编制单位:          ",2,2,0,0));
					ett.add(new Excel_tilte("              年    月",2,2,3,3));
					ett.add(new Excel_tilte("              单位：元",2,2,5,5));
					List<Excel_tilte> et=new ArrayList<Excel_tilte>();//创建一个list存放表头
					et.add(new Excel_tilte("资产",3,3,0,0));
					et.add(new Excel_tilte("期末余额",3,3,1,1));
					et.add(new Excel_tilte("年初余额",3,3,2,2));
					et.add(new Excel_tilte("负债和净资产",3,3,3,3));
					et.add(new Excel_tilte("期末余额",3,3,4,4));
					et.add(new Excel_tilte("年初余额",3,3,5,5));

					eldata.setEl(l);//将实体list放入类中
					eldata.setEtt(ett);//将表头内容设置到类里面
					eldata.setEt(et);//将表头内容设置到类里面
					HttpServletResponse response= getresponse();//获得一个HttpServletResponse
					Excel_export.excel_exportyybb(eldata,response);
				}

			}

		} catch (Exception e) {
			e.printStackTrace();
		}

	}


	public void getZjsymxb(){
		try {

			if("1".equals(elist.getFlag())){
				HttpServletRequest request = ServletActionContext.getRequest();
				HttpSession session = request.getSession();
				String username = (String)session.getAttribute("truename");
//				System.out.println(elist.getNf());
//				elist.setGydw(MyUtil.getQueryDwTJ(elist.getGydw(), "gydwdm","sgydwdm"));
//				elist.setXmjd(MyUtil.getQueryTJ(elist.getXmjd(), "decode(xmjd,'完工已验收','已竣工','完工未验收','已完工',xmjd)"));
//				elist.setTsdq(MyUtil.getQueryTJ(elist.getTsdq() ,"tsdq"));
//				elist.setXmnf(MyUtil.getQueryTJ(elist.getXmnf(), "xdnf"));
//				elist.setXmlx(MyUtil.getQueryxmlxTJ(elist.getXmlx(), "jsxz","gcfl"));
//				System.out.println(elist.getSfmyjc());
//				String sfmyjc="";
//				if(elist.getSfmyjc()==null||"是,否".equals(elist.getSfmyjc())) {
//					sfmyjc="";
//				}else {
//					if("是".equals(elist.getSfmyjc())) {
//						sfmyjc=" and nvl(jy.zjc,0)=0";
//					}else if("否".equals(elist.getSfmyjc())) {
//						sfmyjc=" and nvl(jy.zjc,0)!=0";
//					}else {
//						sfmyjc="";
//					}
//				}
//				elist.setSfmyjc(sfmyjc);
				// List<Excel_list> l = tjbbServer.getZjsymxb(elist);
				List<Excel_list> l = (List<Excel_list>) session.getAttribute("zjsymxb");

				ExcelData eldata=new ExcelData();//创建一个类
				eldata.setTitleName("公路建设资金使用情况明细表");//设置第一行
				eldata.setSheetName("sheet1");//设置sheeet名
				eldata.setFileName("公路建设资金使用情况明细表");//设置文件名

				List<Excel_tilte> et=new ArrayList<Excel_tilte>();//创建一个list存放表头
				et.add(new Excel_tilte("填报单位：",1,1,0,0));
				et.add(new Excel_tilte(username,1,1,1,1));
				et.add(new Excel_tilte("",1,1,2,22));
				et.add(new Excel_tilte("数据统计截止时间：",1,1,23,23));

				et.add(new Excel_tilte(elist.getBbsj(),1,1,24,24));
				et.add(new Excel_tilte("",1,1,25,48));
				et.add(new Excel_tilte("单位：万元",1,1,49,49));

				et.add(new Excel_tilte("投资计划",2,2,0,13));
				et.add(new Excel_tilte("资金",2,2,14,49));


				et.add(new Excel_tilte("序号",3,5,0,0));
				et.add(new Excel_tilte("项目单位",3,5,1,1));
				et.add(new Excel_tilte("项目类型",3,5,2,2));
				et.add(new Excel_tilte("项目名称",3,5,3,3));
				et.add(new Excel_tilte("计划文号",3,5,4,4));
				et.add(new Excel_tilte("以前年度计划",3,3,5,8));
				et.add(new Excel_tilte("本年计划",3,3,9,12));
				et.add(new Excel_tilte("合计",3,5,13,13));
				et.add(new Excel_tilte("结转",3,3,14,20));
				et.add(new Excel_tilte("本年拨入",3,3,21,24));
				et.add(new Excel_tilte("本年拨出",3,3,25,28));
				et.add(new Excel_tilte("当年结存",3,3,29,36));
				et.add(new Excel_tilte("调剂",3,3,37,40));
				et.add(new Excel_tilte("项目进度",3,5,41,41));
				et.add(new Excel_tilte("项目状态",3,3,42,48));
				et.add(new Excel_tilte("备注",3,5,49,49));

				et.add(new Excel_tilte("部补",4,5,5,5));
				et.add(new Excel_tilte("省补",4,5,6,6));
				et.add(new Excel_tilte("地方",4,5,7,7));
				et.add(new Excel_tilte("小计",4,5,8,8));
				et.add(new Excel_tilte("部补",4,5,9,9));
				et.add(new Excel_tilte("省补",4,5,10,10));
				et.add(new Excel_tilte("地方",4,5,11,11));
				et.add(new Excel_tilte("小计",4,5,12,12));


				et.add(new Excel_tilte("部补",4,5,14,14));
				et.add(new Excel_tilte("省补",4,5,15,15));
				et.add(new Excel_tilte("地方",4,5,16,16));
				et.add(new Excel_tilte("合计",4,5,17,17));
				et.add(new Excel_tilte("其中",4,4,18,20));


				et.add(new Excel_tilte("部补",4,5,21,21));
				et.add(new Excel_tilte("省补",4,5,22,22));
				et.add(new Excel_tilte("地方",4,5,23,23));
				et.add(new Excel_tilte("合计",4,5,24,24));
				et.add(new Excel_tilte("部补",4,5,25,25));
				et.add(new Excel_tilte("省补",4,5,26,26));
				et.add(new Excel_tilte("地方",4,5,27,27));
				et.add(new Excel_tilte("合计",4,5,28,28));
				et.add(new Excel_tilte("部补",4,5,29,29));
				et.add(new Excel_tilte("省补",4,5,30,30));
				et.add(new Excel_tilte("地方",4,5,31,31));
				et.add(new Excel_tilte("合计",4,5,32,32));
				et.add(new Excel_tilte("其中",4,4,33,36));
				et.add(new Excel_tilte("部补",4,5,37,37));
				et.add(new Excel_tilte("省补",4,5,38,38));
				et.add(new Excel_tilte("地方",4,5,39,39));
				et.add(new Excel_tilte("合计",4,5,40,40));
				et.add(new Excel_tilte("未开工",4,4,42,45));
				et.add(new Excel_tilte("已开工",4,4,46,46));
				et.add(new Excel_tilte("已完工",4,4,47,48));


				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-3)+"及以前",5,5,18,18));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-2)+"",5,5,19,19));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-1)+"",5,5,20,20));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-3)+"及以前",5,5,33,33));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-2)+"",5,5,34,34));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-1)+"",5,5,35,35));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf()))+"",5,5,36,36));

				et.add(new Excel_tilte("规划（线路）调整，不再实施",5,5,42,42));
				et.add(new Excel_tilte("未完成前期工作",5,5,43,43));
				et.add(new Excel_tilte("地方筹集资金未到位",5,5,44,44));
				et.add(new Excel_tilte("其他（说明详细原因）",5,5,45,45));
				et.add(new Excel_tilte("正常计量",5,5,46,46));
				et.add(new Excel_tilte("待验收",5,5,47,47));
				et.add(new Excel_tilte("质保金",5,5,48,48));

				eldata.setEl(l);//将实体list放入类中
				eldata.setEt(et);//将表头内容设置到类里面

				HttpServletResponse response= getresponse();//获得一个HttpServletResponse

				Excel_export.excel_export(eldata,response);
			}else{
				elist.setGydw(MyUtil.getQueryDwTJ(elist.getGydw(), "gydwdm","sgydwdm"));
				elist.setXmjd(MyUtil.getQueryTJ(elist.getXmjd(), "decode(xmjd,'完工已验收','已竣工','完工未验收','已完工',xmjd)"));
				elist.setTsdq(MyUtil.getQueryTJ(elist.getTsdq() ,"tsdq"));
				elist.setXmnf(MyUtil.getQueryTJ(elist.getXmnf(), "xdnf"));
				elist.setXmlx(MyUtil.getQueryxmlxTJ(elist.getXmlx(), "jsxz","gcfl"));

				System.out.println(elist.getSfmyjc());
				String sfmyjc="";
				if(elist.getSfmyjc()==null||"是,否".equals(elist.getSfmyjc())) {
					sfmyjc="";
				}else {
					if("是".equals(elist.getSfmyjc())) {
						sfmyjc=" and nvl(jy.zjc,0)=0";
					}else if("否".equals(elist.getSfmyjc())) {
						sfmyjc=" and nvl(jy.zjc,0)!=0";
					}else {
						sfmyjc="";
					}
				}
				elist.setSfmyjc(sfmyjc);

				List<Excel_list> l = tjbbServer.getZjsymxb(elist);
				System.out.println("=========1.sizecotl"+l.size());
				getRequest().getSession().setAttribute("zjsymxb", l);
				System.out.println("=========1.asdsd"+l.size());
				JsonUtils.write(l, getresponse().getWriter());
			}

		} catch (Exception e) {
			e.printStackTrace();
		}



	}



	//资金使用单位汇总表
	public void getZjsydwhzb(){
		try {

			if("1".equals(elist.getFlag())){
				HttpServletRequest request = ServletActionContext.getRequest();
				HttpSession session = request.getSession();
//				System.out.println(elist.getNf());
				List<Excel_list> l = (List<Excel_list>) session.getAttribute("zjsydwhzb");
				String username = (String)session.getAttribute("truename");
				ExcelData eldata=new ExcelData();//创建一个类
				eldata.setTitleName("公路建设资金使用情况汇总表（按单位统计）");//设置第一行
				eldata.setSheetName("sheet1");//设置sheeet名
				eldata.setFileName("公路建设资金使用情况汇总表（按单位统计）");//设置文件名
				List<Excel_tilte> et=new ArrayList<Excel_tilte>();//创建一个list存放表头
				et.add(new Excel_tilte("填报单位：",1,1,0,0));
				et.add(new Excel_tilte(username,1,1,1,1));
				et.add(new Excel_tilte("",1,1,2,6));
				et.add(new Excel_tilte("数据统计截止时间：",1,1,7,7));

				et.add(new Excel_tilte(elist.getBbsj(),1,1,8,8));
				et.add(new Excel_tilte("",1,1,9,18));
				et.add(new Excel_tilte("单位：万元",1,1,19,19));


				et.add(new Excel_tilte("投资计划",2,2,0,6));
				et.add(new Excel_tilte("资金",2,2,7,19));


				et.add(new Excel_tilte("序号",3,5,0,0));
				et.add(new Excel_tilte("项目单位",3,5,1,1));
				et.add(new Excel_tilte("项目个数",3,5,2,2));
				et.add(new Excel_tilte("计划文号",3,5,3,3));
				et.add(new Excel_tilte("以前年度计划",3,5,4,4));
				et.add(new Excel_tilte("本年计划",3,5,5,5));
				et.add(new Excel_tilte("合计",3,5,6,6));
				et.add(new Excel_tilte("结转",3,3,7,10));
				et.add(new Excel_tilte("本年拨入",3,5,11,11));
				et.add(new Excel_tilte("本年拨出",3,5,12,12));
				et.add(new Excel_tilte("当年结存",3,3,13,17));
				et.add(new Excel_tilte("调剂",3,5,18,18));
				et.add(new Excel_tilte("备注",3,5,19,19));


				et.add(new Excel_tilte("总数",4,5,7,7));
				et.add(new Excel_tilte("其中",4,4,8,10));
				et.add(new Excel_tilte("总数",4,5,13,13));
				et.add(new Excel_tilte("其中",4,4,14,17));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-3)+"及以前",5,5,8,8));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-2)+"",5,5,9,9));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-1)+"",5,5,10,10));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-3)+"及以前",5,5,14,14));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-2)+"",5,5,15,15));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-1)+"",5,5,16,16));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf()))+"",5,5,17,17));

				eldata.setEl(l);//将实体list放入类中
				eldata.setEt(et);//将表头内容设置到类里面
				HttpServletResponse response= getresponse();//获得一个HttpServletResponse
				Excel_export.excel_export(eldata,response);
			}else{
				elist.setGydw(MyUtil.getQueryDwTJ(elist.getGydw(), "gydwdm","sgydwdm"));
				elist.setXmnf(MyUtil.getQueryTJ(elist.getXmnf(), "xdnf"));
				elist.setJhnf(MyUtil.getQueryTJ(elist.getXmnf(), "xdnf"));
				elist.setXmjd(MyUtil.getQueryTJ(elist.getXmjd(), "decode(xmjd,'完工已验收','已竣工','完工未验收','已完工',xmjd)"));
				elist.setTsdq(MyUtil.getQueryTJ(elist.getTsdq() ,"tsdq"));
				elist.setXmlx(MyUtil.getQueryxmlxTJ(elist.getXmlx(), "jsxz","gcfl"));
				List<Excel_list> l = tjbbServer.getZjsydwhzb(elist);
				int i=1;
				for (Excel_list e : l) {
					e.setV_0(i+"");i++;
				}

				getRequest().getSession().setAttribute("zjsydwhzb", l);
				if(l.size()>1000)
					JsonUtils.write(l.subList(0, 1000), getresponse().getWriter());
				else
					JsonUtils.write(l, getresponse().getWriter());
			}

		} catch (Exception e) {
			e.printStackTrace();
		}



	}

	//资金使用项目汇总表
	public void getZjsyxmhzb(){
		try {

			if("1".equals(elist.getFlag())){
				HttpServletRequest request = ServletActionContext.getRequest();
				HttpSession session = request.getSession();
				String username = (String)session.getAttribute("truename");
//					System.out.println(elist.getNf());
				List<Excel_list> l = (List<Excel_list>) session.getAttribute("zjsyxmhzb");

				ExcelData eldata=new ExcelData();//创建一个类
				eldata.setTitleName("公路建设资金使用情况汇总表（按项目统计）");//设置第一行
				eldata.setSheetName("sheet1");//设置sheeet名
				eldata.setFileName("公路建设资金使用情况汇总表（按项目统计）");//设置文件名

				List<Excel_tilte> et=new ArrayList<Excel_tilte>();//创建一个list存放表头
				et.add(new Excel_tilte("填报单位：",1,1,0,0));
				et.add(new Excel_tilte(username,1,1,1,1));
				et.add(new Excel_tilte("",1,1,2,6));
				et.add(new Excel_tilte("数据统计截止时间：",1,1,7,7));

				et.add(new Excel_tilte(elist.getBbsj(),1,1,8,8));
				et.add(new Excel_tilte("",1,1,9,18));
				et.add(new Excel_tilte("单位：万元",1,1,19,19));


				et.add(new Excel_tilte("投资计划",2,2,0,6));
				et.add(new Excel_tilte("资金",2,2,7,19));


				et.add(new Excel_tilte("序号",3,5,0,0));
				et.add(new Excel_tilte("项目单位",3,5,1,1));
				et.add(new Excel_tilte("项目个数",3,5,2,2));
				et.add(new Excel_tilte("计划文号",3,5,3,3));
				et.add(new Excel_tilte("以前年度计划",3,5,4,4));
				et.add(new Excel_tilte("本年计划",3,5,5,5));
				et.add(new Excel_tilte("合计",3,5,6,6));
				et.add(new Excel_tilte("结转",3,3,7,10));
				et.add(new Excel_tilte("本年拨入",3,5,11,11));
				et.add(new Excel_tilte("本年拨出",3,5,12,12));
				et.add(new Excel_tilte("当年结存",3,3,13,17));
				et.add(new Excel_tilte("调剂",3,5,18,18));
				et.add(new Excel_tilte("备注",3,5,19,19));


				et.add(new Excel_tilte("总数",4,5,7,7));
				et.add(new Excel_tilte("其中",4,4,8,10));
				et.add(new Excel_tilte("总数",4,5,13,13));
				et.add(new Excel_tilte("其中",4,4,14,17));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-3)+"及以前",5,5,8,8));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-2)+"",5,5,9,9));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-1)+"",5,5,10,10));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-3)+"及以前",5,5,14,14));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-2)+"",5,5,15,15));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-1)+"",5,5,16,16));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf()))+"",5,5,17,17));


				eldata.setEl(l);//将实体list放入类中
				eldata.setEt(et);//将表头内容设置到类里面
				HttpServletResponse response= getresponse();//获得一个HttpServletResponse
				Excel_export.excel_export(eldata,response);
			}else{
				elist.setGydw(MyUtil.getQueryDwTJ(elist.getGydw(), "gydwdm","sgydwdm"));
				elist.setXmnf(MyUtil.getQueryTJ(elist.getXmnf(), "xdnf"));
				elist.setXmlx(MyUtil.getQueryxmlxTJ(elist.getXmlx(), "jsxz","gcfl"));
				elist.setXmjd(MyUtil.getQueryTJ(elist.getXmjd(), "decode(xmjd,'完工已验收','已竣工','完工未验收','已完工',xmjd)"));
				elist.setTsdq(MyUtil.getQueryTJ(elist.getTsdq() ,"tsdq"));
				List<Excel_list> l = tjbbServer.getZjsyxmhzb(elist);
				int i=1;
				for (Excel_list e : l) {
					e.setV_0(i+"");i++;
				}
				getRequest().getSession().setAttribute("zjsyxmhzb", l);
				if(l.size()>1000)
					JsonUtils.write(l.subList(0, 1000), getresponse().getWriter());
				else
					JsonUtils.write(l, getresponse().getWriter());
			}

		} catch (Exception e) {
			e.printStackTrace();
		}



	}

	//省补资金下拨明细表表头
	public void getSbzjxbmxbbt(){
		try {

			if("1".equals(elist.getFlag())){
				HttpServletRequest request = ServletActionContext.getRequest();
				HttpSession session = request.getSession();

				elist.setGydw(MyUtil.getQueryDwTJ(elist.getGydw(), "dwdm"));
				elist.setXmnf(MyUtil.getQueryTJ(elist.getXmnf(), "xmnf"));
				elist.setJwh(MyUtil.getQueryTJ(elist.getJhxdwh(), "jwh"));
				List<Excel_list> l = new ArrayList<Excel_list>();
				System.out.println("进入contl方法");
				String [][] arr=tjbbServer.getSbzjxbmxb(elist);
				System.out.println("111111::");
				for(int i=0;i<arr.length;i++){
					Excel_list el=new Excel_list();
					for(int j=1;j<Integer.valueOf(arr[i][0]);j++){
						//el.getMethod("setV_"+j)(arr[i][j]);
						//el.set[j-1](arr[i][j]);

						Field name = el.getClass().getDeclaredField("v_"+(j-1));
						name.setAccessible(true);
						name.set(el, arr[i][j]);
						//  System.out.println(el.get);


					}
					l.add(el);
				}

				System.out.println("2222222::");
				ExcelData eldata=new ExcelData();//创建一个类
				eldata.setTitleName("省补资金下拨明细表");//设置第一行
				eldata.setSheetName("sheet1");//设置sheeet名
				eldata.setFileName("省补资金下拨明细表");//设置文件名

				List<Excel_tilte> et=tjbbServer.getSbzjxbmxbBtDc(elist);
				//new ArrayList<Excel_tilte>();//创建一个list存放表头


				eldata.setEl(l);//将实体list放入类中
				eldata.setEt(et);//将表头内容设置到类里面
				System.out.println("333333::");
				HttpServletResponse response= getresponse();//获得一个HttpServletResponse
				Excel_export.excel_export(eldata,response);
			}else{
				System.out.println(elist.getFlag()+"::"+elist.getGydw()+"::"+elist.getJhxdwh()+"::"+elist.getXmnf()+"::"+elist.getXmmc()+"::"+elist.getNf());
				elist.setGydw(MyUtil.getQueryDwTJ(elist.getGydw(), "dwdm"));
				elist.setXmnf(MyUtil.getQueryTJ(elist.getXmnf(), "xmnf"));
				elist.setJwh(MyUtil.getQueryTJ(elist.getJhxdwh(), "jwh"));
				List<Excel_list> l = tjbbServer.getSbzjxbmxbBt(elist);
				JsonUtils.write(l, getresponse().getWriter());
					/*int i=1;
					for (Excel_list e : l) {
						e.setV_0(i+"");i++;
					}
					getRequest().getSession().setAttribute("zjsyxmhzb", l);
					if(l.size()>1000)
						JsonUtils.write(l.subList(0, 1000), getresponse().getWriter());
						else
						JsonUtils.write(l, getresponse().getWriter());*/
			}

		} catch (Exception e) {
			e.printStackTrace();
		}



	}
	//资金投入情况统计表表头
	public void getSbzjtrqkbbt(){
		try {

			if("1".equals(elist.getFlag())){
				HttpServletRequest request = ServletActionContext.getRequest();
				HttpSession session = request.getSession();

				elist.setGydw(MyUtil.getQueryDwTJ(elist.getGydw(), "dwdm"));
				elist.setXmnf(MyUtil.getQueryTJ(elist.getXmnf(), "xmnf"));
//					elist.setJwh(MyUtil.getQueryTJ(elist.getJhxdwh(), "jwh"));
				List<Excel_list> l = new ArrayList<Excel_list>();
				String [][] arr=tjbbServer.getSbzjtrqkb(elist);
				for(int i=0;i<arr.length;i++){
					Excel_list el=new Excel_list();
					for(int j=0;j<Integer.valueOf(arr[i].length);j++){
						//el.getMethod("setV_"+j)(arr[i][j]);
						//el.set[j-1](arr[i][j]);

						Field name = el.getClass().getDeclaredField("v_"+(j));
						name.setAccessible(true);
						name.set(el, arr[i][j]);
						//  System.out.println(el.get);


					}
					l.add(el);
				}


				ExcelData eldata=new ExcelData();//创建一个类
				eldata.setTitleName("省补资金下拨明细表");//设置第一行
				eldata.setSheetName("sheet1");//设置sheeet名
				eldata.setFileName("省补资金下拨明细表");//设置文件名

				List<Excel_tilte> et=tjbbServer.getSbzjtrqkxbmxbBtDc(elist);
				//new ArrayList<Excel_tilte>();//创建一个list存放表头


				eldata.setEl(l);//将实体list放入类中
				eldata.setEt(et);//将表头内容设置到类里面
				HttpServletResponse response= getresponse();//获得一个HttpServletResponse
				Excel_export.excel_export(eldata,response);
			}else{
				System.out.println(elist.getFlag()+"::"+elist.getGydw()+"::"+elist.getJhxdwh()+"::"+elist.getXmnf()+"::"+elist.getXmmc()+"::"+elist.getNf());
				elist.setXmnf(MyUtil.getQueryTJ(elist.getXmnf(), "xmnf"));
				List<Excel_list> l = tjbbServer.getSbzjtrqkbbt(elist);
				JsonUtils.write(l, getresponse().getWriter());
			}

		} catch (Exception e) {
			e.printStackTrace();
		}



	}


	//普通公路车购税资金建设计划汇总表
	public void getPtglcgszjjsjhhzbBt(){
		try {

			if("1".equals(elist.getFlag())){
				HttpServletRequest request = ServletActionContext.getRequest();
				HttpSession session = request.getSession();

				elist.setGydwdm(MyUtil.getQueryDwTJ(elist.getGydw(), "t.gydwdm"));
				elist.setXdnf(MyUtil.getQueryTJ(elist.getXdnf(), "t.xdnf"));
				elist.setJsxz(MyUtil.getQueryTJIN(elist.getXmlx(), "t.jsxz"));
//                    elist.setXmjd(MyUtil.getQueryTJIN(elist.getXmjd(), "t.xmjd"));

				List<Excel_list> l = new ArrayList<Excel_list>();
				String [][] arr=tjbbServer.getPtglcgszjjsjhhzbBtmx(elist);

				for(int i=0;i<arr.length;i++){
					Excel_list el=new Excel_list();
					for(int j=0;j<Integer.valueOf(arr[i].length);j++){
						Field name = el.getClass().getDeclaredField("v_"+(j));
						name.setAccessible(true);
						name.set(el, arr[i][j]);
					}
					l.add(el);
				}


				ExcelData eldata=new ExcelData();//创建一个类
				eldata.setTitleName("普通公路车购税资金建设计划汇总表");//设置第一行
				eldata.setSheetName("汇总表");//设置sheeet名
				eldata.setFileName("普通公路车购税资金建设计划汇总表");//设置文件名

				List<Excel_tilte> et=tjbbServer.getPtglcgszjjsjhhzbBtDc(elist);
				//new ArrayList<Excel_tilte>();//创建一个list存放表头


				eldata.setEl(l);//将实体list放入类中
				eldata.setEt(et);//将表头内容设置到类里面
				HttpServletResponse response= getresponse();//获得一个HttpServletResponse
				Excel_export.excel_export(eldata,response);
			}else{
				System.out.println(elist.getFlag()+"::"+elist.getGydw()+"::"+elist.getJhxdwh()+"::"+elist.getXmnf()+"::"+elist.getXmmc()+"::"+elist.getNf());

//					elist.setGydwdm(MyUtil.getQueryDwTJ(elist.getGydw(), "t.gydwdm"));
//					elist.setXdnf(MyUtil.getQueryTJ(elist.getXdnf(), "t.xdnf"));
				elist.setJsxz(MyUtil.getQueryTJIN(elist.getXmlx(), "t.jsxz"));

				List<Excel_list> l = tjbbServer.getPtglcgszjjsjhhzbBt(elist);
				JsonUtils.write(l, getresponse().getWriter());
			}

		} catch (Exception e) {
			e.printStackTrace();
		}



	}
	//资金投入情况统计明细表
	public void getSbzjtrqkb(){
		try {

			if("1".equals(elist.getFlag())){
			}else{
				System.out.println(elist.getFlag()+"::"+elist.getGydw()+"::"+elist.getJhxdwh()+"::"+elist.getXmnf()+"::"+elist.getXmmc()+"::"+elist.getNf());

				elist.setGydw(MyUtil.getQueryDwTJ(elist.getGydw(), "dwdm"));
				elist.setXmnf(MyUtil.getQueryTJ(elist.getXmnf(), "xmnf"));
				elist.setJwh(MyUtil.getQueryTJ(elist.getJhxdwh(), "jwh"));
				System.out.println("===elist.getGydw()::"+elist.getGydw()+"elist.getJhxdwh()::"+elist.getJhxdwh()+"elist.getXmnf()::"+elist.getXmnf()+"elist.getXmmc()::"+elist.getXmmc()+"elist.getNf()::"+elist.getNf());

				String arr[][] = tjbbServer.getSbzjtrqkb(elist);
				JsonUtils.write(arr, getresponse().getWriter());
							/*int i=1;
							for (Excel_list e : l) {
								e.setV_0(i+"");i++;
							}
							getRequest().getSession().setAttribute("zjsyxmhzb", l);
							if(l.size()>1000)
								JsonUtils.write(l.subList(0, 1000), getresponse().getWriter());
								else
								JsonUtils.write(l, getresponse().getWriter());*/
			}

		} catch (Exception e) {
			e.printStackTrace();
		}

	}

	//普通公路车购税资金建设计划统计明细表
	public void getPtglcgszjjsjhhzbBtmx(){
		try {

			if("1".equals(elist.getFlag())){
			}else{
				System.out.println(elist.getFlag()+"::"+elist.getGydw()+"::"+elist.getJhxdwh()+"::"+elist.getXmnf()+"::"+elist.getXmmc()+"::"+elist.getNf());

				elist.setGydwdm(MyUtil.getQueryDwTJ(elist.getGydw(), "t.gydwdm"));
				elist.setXdnf(MyUtil.getQueryTJ(elist.getXdnf(), "t.xdnf"));
				elist.setJsxz(MyUtil.getQueryTJIN(elist.getXmlx(), "t.jsxz"));
//                elist.setXmjd(MyUtil.getQueryTJIN(elist.getXmjd(), "t.xmjd"));
				System.out.println("===elist.getGydw()::"+elist.getGydw()+"elist.getJhxdwh()::"+elist.getJhxdwh()+"elist.getXmnf()::"+elist.getXmnf()+"elist.getXmmc()::"+elist.getXmmc()+"elist.getNf()::"+elist.getNf());

				String arr[][] = tjbbServer.getPtglcgszjjsjhhzbBtmx(elist);
				JsonUtils.write(arr, getresponse().getWriter());
			}

		} catch (Exception e) {
			e.printStackTrace();
		}

	}


	//省补资金下拨明细表
	public void getSbzjxbmxb(){
		try {

			if("1".equals(elist.getFlag())){
			}else{
				System.out.println(elist.getFlag()+"::"+elist.getGydw()+"::"+elist.getJhxdwh()+"::"+elist.getXmnf()+"::"+elist.getXmmc()+"::"+elist.getNf());

				elist.setGydw(MyUtil.getQueryDwTJ(elist.getGydw(), "dwdm"));
				elist.setXmnf(MyUtil.getQueryTJ(elist.getXmnf(), "xmnf"));
				elist.setJwh(MyUtil.getQueryTJ(elist.getJhxdwh(), "jwh"));
				System.out.println("===elist.getGydw()::"+elist.getGydw()+"elist.getJhxdwh()::"+elist.getJhxdwh()+"elist.getXmnf()::"+elist.getXmnf()+"elist.getXmmc()::"+elist.getXmmc()+"elist.getNf()::"+elist.getNf());

				String arr[][] = tjbbServer.getSbzjxbmxb(elist);
				JsonUtils.write(arr, getresponse().getWriter());
							/*int i=1;
							for (Excel_list e : l) {
								e.setV_0(i+"");i++;
							}
							getRequest().getSession().setAttribute("zjsyxmhzb", l);
							if(l.size()>1000)
								JsonUtils.write(l.subList(0, 1000), getresponse().getWriter());
								else
								JsonUtils.write(l, getresponse().getWriter());*/
			}

		} catch (Exception e) {
			e.printStackTrace();
		}



	}

	//省补计划金额和请款情况明细表表头
	public void getSbzjjhqkmxbbt(){
		try {

			if("1".equals(elist.getFlag())){
				HttpServletRequest request = ServletActionContext.getRequest();
				HttpSession session = request.getSession();

				elist.setGydw(MyUtil.getQueryDwTJ(elist.getGydw(), "dwdm"));
				elist.setJwh(MyUtil.getQueryTJ(elist.getJhxdwh(), "jwh"));

				List<Excel_list> l = new ArrayList<Excel_list>();
				String [][] arr=tjbbServer.getSbzjjhqkmxb(elist);
				for(int i=0;i<arr.length;i++){
					Excel_list el=new Excel_list();
					System.out.println("arr[0][0]:"+arr[0][0]);
					for(int j=0;j<arr[i].length;j++){
						//el.getMethod("setV_"+j)(arr[i][j]);
						//el.set[j-1](arr[i][j]);

						Field name = el.getClass().getDeclaredField("v_"+j);
						name.setAccessible(true);
						name.set(el, arr[i][j]);
						//  System.out.println(el.get);


					}
					l.add(el);
				}


				ExcelData eldata=new ExcelData();//创建一个类
				eldata.setTitleName("省补计划金额和请款情况明细表");//设置第一行
				eldata.setSheetName("sheet1");//设置sheeet名
				eldata.setFileName("省补计划金额和请款情况明细表");//设置文件名

				List<Excel_tilte> et=tjbbServer.getSbzjjhqkmxbbtDc(elist);
				//new ArrayList<Excel_tilte>();//创建一个list存放表头


				eldata.setEl(l);//将实体list放入类中
				eldata.setEt(et);//将表头内容设置到类里面
				HttpServletResponse response= getresponse();//获得一个HttpServletResponse
				Excel_export.excel_export(eldata,response);


			}else{
				elist.setGydw(MyUtil.getQueryDwTJ(elist.getGydw(), "dwdm"));
				elist.setJwh(MyUtil.getQueryTJ(elist.getJhxdwh(), "jwh"));
				List<Excel_list> l = tjbbServer.getSbzjjhqkmxbbt(elist);
				JsonUtils.write(l, getresponse().getWriter());
							/*int i=1;
							for (Excel_list e : l) {
								e.setV_0(i+"");i++;
							}
							getRequest().getSession().setAttribute("zjsyxmhzb", l);
							if(l.size()>1000)
								JsonUtils.write(l.subList(0, 1000), getresponse().getWriter());
								else
								JsonUtils.write(l, getresponse().getWriter());*/
			}

		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	//省补计划金额和请款情况明细表
	public void getSbzjjhqkmxb(){
		try {

			if("1".equals(elist.getFlag())){
			}else{
				elist.setGydw(MyUtil.getQueryDwTJ(elist.getGydw(), "dwdm"));
				elist.setJwh(MyUtil.getQueryTJ(elist.getJhxdwh(), "jwh"));

				String arr[][] = tjbbServer.getSbzjjhqkmxb(elist);
				JsonUtils.write(arr, getresponse().getWriter());
							/*int i=1;
							for (Excel_list e : l) {
								e.setV_0(i+"");i++;
							}
							getRequest().getSession().setAttribute("zjsyxmhzb", l);
							if(l.size()>1000)
								JsonUtils.write(l.subList(0, 1000), getresponse().getWriter());
								else
								JsonUtils.write(l, getresponse().getWriter());*/
			}

		} catch (Exception e) {
			e.printStackTrace();
		}



	}

	//资金使用单位部补汇总表
	public void getZjsydwbbhzb(){
		try {

			if("1".equals(elist.getFlag())){
				HttpServletRequest request = ServletActionContext.getRequest();
				HttpSession session = request.getSession();
				String username = (String)session.getAttribute("truename");
//					System.out.println(elist.getNf());
				List<Excel_list> l = (List<Excel_list>) session.getAttribute("zjsydwbbhzb");

				ExcelData eldata=new ExcelData();//创建一个类
				eldata.setTitleName("公路建设车购税资金使用情况汇总表（按单位统计）");//设置第一行
				eldata.setSheetName("sheet1");//设置sheeet名
				eldata.setFileName("公路建设车购税资金使用情况汇总表（按单位统计）");//设置文件名

				List<Excel_tilte> et=new ArrayList<Excel_tilte>();//创建一个list存放表头
				et.add(new Excel_tilte("填报单位：",1,1,0,0));
				et.add(new Excel_tilte(username,1,1,1,1));
				et.add(new Excel_tilte("",1,1,2,6));
				et.add(new Excel_tilte("数据统计截止时间：",1,1,7,7));
				et.add(new Excel_tilte(elist.getBbsj(),1,1,8,8));
				et.add(new Excel_tilte("",1,1,9,18));
				et.add(new Excel_tilte("单位：万元",1,1,19,19));

				et.add(new Excel_tilte("投资计划",2,2,0,6));
				et.add(new Excel_tilte("资金",2,2,7,19));

				et.add(new Excel_tilte("序号",3,5,0,0));
				et.add(new Excel_tilte("项目单位",3,5,1,1));
				et.add(new Excel_tilte("项目个数",3,5,2,2));
				et.add(new Excel_tilte("计划文号",3,5,3,3));
				et.add(new Excel_tilte("以前年度计划",3,5,4,4));
				et.add(new Excel_tilte("本年计划",3,5,5,5));
				et.add(new Excel_tilte("合计",3,5,6,6));
				et.add(new Excel_tilte("结转",3,3,7,10));
				et.add(new Excel_tilte("本年拨入",3,5,11,11));
				et.add(new Excel_tilte("本年拨出",3,5,12,12));
				et.add(new Excel_tilte("当年结存",3,3,13,17));
				et.add(new Excel_tilte("调剂",3,5,18,18));
				et.add(new Excel_tilte("备注",3,5,19,19));


				et.add(new Excel_tilte("总数",4,5,7,7));
				et.add(new Excel_tilte("其中",4,4,8,10));
				et.add(new Excel_tilte("总数",4,5,13,13));
				et.add(new Excel_tilte("其中",4,4,14,17));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-3)+"及以前",5,5,8,8));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-2)+"",5,5,9,9));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-1)+"",5,5,10,10));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-3)+"及以前",5,5,14,14));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-2)+"",5,5,15,15));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-1)+"",5,5,16,16));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf()))+"",5,5,17,17));

				eldata.setEl(l);//将实体list放入类中
				eldata.setEt(et);//将表头内容设置到类里面
				HttpServletResponse response= getresponse();//获得一个HttpServletResponse
				Excel_export.excel_export(eldata,response);
			}else{
				elist.setGydw(MyUtil.getQueryDwTJ(elist.getGydw(), "gydwdm","sgydwdm"));
				elist.setXmnf(MyUtil.getQueryTJ(elist.getXmnf(), "xdnf"));
				elist.setJhnf(MyUtil.getQueryTJ(elist.getXmnf(), "xdnf"));
				elist.setXmjd(MyUtil.getQueryTJ(elist.getXmjd(), "decode(xmjd,'完工已验收','已竣工','完工未验收','已完工',xmjd)"));
				elist.setTsdq(MyUtil.getQueryTJ(elist.getTsdq() ,"tsdq"));
				elist.setXmlx(MyUtil.getQueryxmlxTJ(elist.getXmlx(), "jsxz","gcfl"));
				List<Excel_list> l = tjbbServer.getZjsydwbbhzb(elist);
				int i=1;
				for (Excel_list e : l) {
					e.setV_0(i+"");i++;
				}
				getRequest().getSession().setAttribute("zjsydwbbhzb", l);
				if(l.size()>1000)
					JsonUtils.write(l.subList(0, 1000), getresponse().getWriter());
				else
					JsonUtils.write(l, getresponse().getWriter());
			}

		} catch (Exception e) {
			e.printStackTrace();
		}

	}


	//资金使用单位省补汇总表
	public void getZjsydwsbhzb(){
		try {

			if("1".equals(elist.getFlag())){
				HttpServletRequest request = ServletActionContext.getRequest();
				HttpSession session = request.getSession();
				String username = (String)session.getAttribute("truename");
//					System.out.println(elist.getNf());
				List<Excel_list> l = (List<Excel_list>) session.getAttribute("zjsydwsbhzb");

				ExcelData eldata=new ExcelData();//创建一个类
				eldata.setTitleName("公路建设省补资金使用情况汇总表（按单位统计）");//设置第一行
				eldata.setSheetName("sheet1");//设置sheeet名
				eldata.setFileName("公路建设省补资金使用情况汇总表（按单位统计）");//设置文件名

				List<Excel_tilte> et=new ArrayList<Excel_tilte>();//创建一个list存放表头
				et.add(new Excel_tilte("填报单位：",1,1,0,0));
				et.add(new Excel_tilte(username,1,1,1,1));
				et.add(new Excel_tilte("",1,1,2,6));
				et.add(new Excel_tilte("数据统计截止时间：",1,1,7,7));
				et.add(new Excel_tilte(elist.getBbsj(),1,1,8,8));
				et.add(new Excel_tilte("",1,1,9,18));
				et.add(new Excel_tilte("单位：万元",1,1,19,19));

				et.add(new Excel_tilte("投资计划",2,2,0,6));
				et.add(new Excel_tilte("资金",2,2,7,19));

				et.add(new Excel_tilte("序号",3,5,0,0));
				et.add(new Excel_tilte("项目单位",3,5,1,1));
				et.add(new Excel_tilte("项目个数",3,5,2,2));
				et.add(new Excel_tilte("计划文号",3,5,3,3));
				et.add(new Excel_tilte("以前年度计划",3,5,4,4));
				et.add(new Excel_tilte("本年计划",3,5,5,5));
				et.add(new Excel_tilte("合计",3,5,6,6));
				et.add(new Excel_tilte("结转",3,3,7,10));
				et.add(new Excel_tilte("本年拨入",3,5,11,11));
				et.add(new Excel_tilte("本年拨出",3,5,12,12));
				et.add(new Excel_tilte("当年结存",3,3,13,17));
				et.add(new Excel_tilte("调剂",3,5,18,18));
				et.add(new Excel_tilte("备注",3,5,19,19));


				et.add(new Excel_tilte("总数",4,5,7,7));
				et.add(new Excel_tilte("其中",4,4,8,10));
				et.add(new Excel_tilte("总数",4,5,13,13));
				et.add(new Excel_tilte("其中",4,4,14,17));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-3)+"及以前",5,5,8,8));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-2)+"",5,5,9,9));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-1)+"",5,5,10,10));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-3)+"及以前",5,5,14,14));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-2)+"",5,5,15,15));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-1)+"",5,5,16,16));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf()))+"",5,5,17,17));

				eldata.setEl(l);//将实体list放入类中
				eldata.setEt(et);//将表头内容设置到类里面
				HttpServletResponse response= getresponse();//获得一个HttpServletResponse
				Excel_export.excel_export(eldata,response);
			}else{
				elist.setGydw(MyUtil.getQueryDwTJ(elist.getGydw(), "gydwdm","sgydwdm"));
				elist.setXmnf(MyUtil.getQueryTJ(elist.getXmnf(), "xdnf"));
				elist.setJhnf(MyUtil.getQueryTJ(elist.getXmnf(), "xdnf"));
				elist.setXmjd(MyUtil.getQueryTJ(elist.getXmjd(), "decode(xmjd,'完工已验收','已竣工','完工未验收','已完工',xmjd)"));
				elist.setTsdq(MyUtil.getQueryTJ(elist.getTsdq() ,"tsdq"));
				elist.setXmlx(MyUtil.getQueryxmlxTJ(elist.getXmlx(), "jsxz","gcfl"));
				List<Excel_list> l = tjbbServer.getZjsydwsbhzb(elist);
				int i=1;
				for (Excel_list e : l) {
					e.setV_0(i+"");i++;
				}
				getRequest().getSession().setAttribute("zjsydwsbhzb", l);
				if(l.size()>1000)
					JsonUtils.write(l.subList(0, 1000), getresponse().getWriter());
				else
					JsonUtils.write(l, getresponse().getWriter());
			}

		} catch (Exception e) {
			e.printStackTrace();
		}

	}
	//------------------------------------------
	//资金使用项目车购税汇总表
	public void getZjsyxmbbhzb(){
		try {

			if("1".equals(elist.getFlag())){
				HttpServletRequest request = ServletActionContext.getRequest();
				HttpSession session = request.getSession();
				String username = (String)session.getAttribute("truename");
//						System.out.println(elist.getNf());
				List<Excel_list> l = (List<Excel_list>) session.getAttribute("zjsyxmbbhzb");
				ExcelData eldata=new ExcelData();//创建一个类
				eldata.setTitleName("公路建设车购税资金使用情况汇总表（按项目统计）");//设置第一行
				eldata.setSheetName("sheet1");//设置sheeet名
				eldata.setFileName("公路建设车购税资金使用情况汇总表（按项目统计）");//设置文件名
				List<Excel_tilte> et=new ArrayList<Excel_tilte>();//创建一个list存放表头
				et.add(new Excel_tilte("填报单位：",1,1,0,0));
				et.add(new Excel_tilte(username,1,1,1,1));
				et.add(new Excel_tilte("",1,1,2,6));
				et.add(new Excel_tilte("数据统计截止时间：",1,1,7,7));
				et.add(new Excel_tilte(elist.getBbsj(),1,1,8,8));
				et.add(new Excel_tilte("",1,1,9,18));
				et.add(new Excel_tilte("单位：万元",1,1,19,19));
				et.add(new Excel_tilte("投资计划",2,2,0,6));
				et.add(new Excel_tilte("资金",2,2,7,19));
				et.add(new Excel_tilte("序号",3,5,0,0));
				et.add(new Excel_tilte("项目单位",3,5,1,1));
				et.add(new Excel_tilte("项目个数",3,5,2,2));
				et.add(new Excel_tilte("计划文号",3,5,3,3));
				et.add(new Excel_tilte("以前年度计划",3,5,4,4));
				et.add(new Excel_tilte("本年计划",3,5,5,5));
				et.add(new Excel_tilte("合计",3,5,6,6));
				et.add(new Excel_tilte("结转",3,3,7,10));
				et.add(new Excel_tilte("本年拨入",3,5,11,11));
				et.add(new Excel_tilte("本年拨出",3,5,12,12));
				et.add(new Excel_tilte("当年结存",3,3,13,17));
				et.add(new Excel_tilte("调剂",3,5,18,18));
				et.add(new Excel_tilte("备注",3,5,19,19));
				et.add(new Excel_tilte("总数",4,5,7,7));
				et.add(new Excel_tilte("其中",4,4,8,10));
				et.add(new Excel_tilte("总数",4,5,13,13));
				et.add(new Excel_tilte("其中",4,4,14,17));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-3)+"及以前",5,5,8,8));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-2)+"",5,5,9,9));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-1)+"",5,5,10,10));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-3)+"及以前",5,5,14,14));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-2)+"",5,5,15,15));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-1)+"",5,5,16,16));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf()))+"",5,5,17,17));

				eldata.setEl(l);//将实体list放入类中
				eldata.setEt(et);//将表头内容设置到类里面
				HttpServletResponse response= getresponse();//获得一个HttpServletResponse
				Excel_export.excel_export(eldata,response);
			}else{
				elist.setGydw(MyUtil.getQueryDwTJ(elist.getGydw(), "gydwdm","sgydwdm"));
				elist.setXmnf(MyUtil.getQueryTJ(elist.getXmnf(), "xdnf"));
				elist.setXmlx(MyUtil.getQueryxmlxTJ(elist.getXmlx(), "jsxz","gcfl"));
				elist.setXmjd(MyUtil.getQueryTJ(elist.getXmjd(), "decode(xmjd,'完工已验收','已竣工','完工未验收','已完工',xmjd)"));
				elist.setTsdq(MyUtil.getQueryTJ(elist.getTsdq() ,"tsdq"));
				List<Excel_list> l = tjbbServer.getZjsyxmbbhzb(elist);
				int i=1;
				for (Excel_list e : l) {
					e.setV_0(i+"");i++;
				}
				getRequest().getSession().setAttribute("zjsyxmbbhzb", l);
				if(l.size()>1000)
					JsonUtils.write(l.subList(0, 1000), getresponse().getWriter());
				else
					JsonUtils.write(l, getresponse().getWriter());
			}

		} catch (Exception e) {
			e.printStackTrace();
		}

	}

	//资金使用项目省补汇总表
	public void getZjsyxmsbhzb(){
		try {

			if("1".equals(elist.getFlag())){
				HttpServletRequest request = ServletActionContext.getRequest();
				HttpSession session = request.getSession();
				String username = (String)session.getAttribute("truename");
//								System.out.println(elist.getNf());
				List<Excel_list> l = (List<Excel_list>) session.getAttribute("zjsyxmsbhzb");
				ExcelData eldata=new ExcelData();//创建一个类
				eldata.setTitleName("公路建设省补资金使用情况汇总表（按项目统计）");//设置第一行
				eldata.setSheetName("sheet1");//设置sheeet名
				eldata.setFileName("公路建设省补资金使用情况汇总表（按项目统计）");//设置文件名
				List<Excel_tilte> et=new ArrayList<Excel_tilte>();//创建一个list存放表头
				et.add(new Excel_tilte("填报单位：",1,1,0,0));
				et.add(new Excel_tilte(username,1,1,1,1));
				et.add(new Excel_tilte("",1,1,2,6));
				et.add(new Excel_tilte("数据统计截止时间：",1,1,7,7));
				et.add(new Excel_tilte(elist.getBbsj(),1,1,8,8));
				et.add(new Excel_tilte("",1,1,9,18));
				et.add(new Excel_tilte("单位：万元",1,1,19,19));
				et.add(new Excel_tilte("投资计划",2,2,0,6));
				et.add(new Excel_tilte("资金",2,2,7,19));
				et.add(new Excel_tilte("序号",3,5,0,0));
				et.add(new Excel_tilte("项目单位",3,5,1,1));
				et.add(new Excel_tilte("项目个数",3,5,2,2));
				et.add(new Excel_tilte("计划文号",3,5,3,3));
				et.add(new Excel_tilte("以前年度计划",3,5,4,4));
				et.add(new Excel_tilte("本年计划",3,5,5,5));
				et.add(new Excel_tilte("合计",3,5,6,6));
				et.add(new Excel_tilte("结转",3,3,7,10));
				et.add(new Excel_tilte("本年拨入",3,5,11,11));
				et.add(new Excel_tilte("本年拨出",3,5,12,12));
				et.add(new Excel_tilte("当年结存",3,3,13,17));
				et.add(new Excel_tilte("调剂",3,5,18,18));
				et.add(new Excel_tilte("备注",3,5,19,19));
				et.add(new Excel_tilte("总数",4,5,7,7));
				et.add(new Excel_tilte("其中",4,4,8,10));
				et.add(new Excel_tilte("总数",4,5,13,13));
				et.add(new Excel_tilte("其中",4,4,14,17));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-3)+"及以前",5,5,8,8));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-2)+"",5,5,9,9));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-1)+"",5,5,10,10));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-3)+"及以前",5,5,14,14));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-2)+"",5,5,15,15));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-1)+"",5,5,16,16));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf()))+"",5,5,17,17));

				eldata.setEl(l);//将实体list放入类中
				eldata.setEt(et);//将表头内容设置到类里面
				HttpServletResponse response= getresponse();//获得一个HttpServletResponse
				Excel_export.excel_export(eldata,response);
			}else{
				elist.setGydw(MyUtil.getQueryDwTJ(elist.getGydw(), "gydwdm","sgydwdm"));
				elist.setXmnf(MyUtil.getQueryTJ(elist.getXmnf(), "xdnf"));
				elist.setXmlx(MyUtil.getQueryxmlxTJ(elist.getXmlx(), "jsxz","gcfl"));
				elist.setXmjd(MyUtil.getQueryTJ(elist.getXmjd(), "decode(xmjd,'完工已验收','已竣工','完工未验收','已完工',xmjd)"));
				elist.setTsdq(MyUtil.getQueryTJ(elist.getTsdq() ,"tsdq"));
				List<Excel_list> l = tjbbServer.getZjsyxmsbhzb(elist);
				int i=1;
				for (Excel_list e : l) {
					e.setV_0(i+"");i++;
				}
				getRequest().getSession().setAttribute("zjsyxmsbhzb", l);
				if(l.size()>1000)
					JsonUtils.write(l.subList(0, 1000), getresponse().getWriter());
				else
					JsonUtils.write(l, getresponse().getWriter());
			}

		} catch (Exception e) {
			e.printStackTrace();
		}

	}

	//---------------------------------------
	//资金使用单位部补汇总表
	public void getZjsydwbbsbhzb(){
		try {

			if("1".equals(elist.getFlag())){
				HttpServletRequest request = ServletActionContext.getRequest();
				HttpSession session = request.getSession();
				String username = (String)session.getAttribute("truename");
//						System.out.println(elist.getNf());
				List<Excel_list> l = (List<Excel_list>) session.getAttribute("getZjsydwbbsbhzb");

				ExcelData eldata=new ExcelData();//创建一个类
				eldata.setTitleName("公路建设车购税、省补合计资金使用情况汇总表（按单位统计）");//设置第一行
				eldata.setSheetName("sheet1");//设置sheeet名
				eldata.setFileName("公路建设车购税、省补合计资金使用情况汇总表（按单位统计）");//设置文件名

				List<Excel_tilte> et=new ArrayList<Excel_tilte>();//创建一个list存放表头
				et.add(new Excel_tilte("填报单位：",1,1,0,0));
				et.add(new Excel_tilte(username,1,1,1,1));
				et.add(new Excel_tilte("",1,1,2,6));
				et.add(new Excel_tilte("数据统计截止时间：",1,1,7,7));
				et.add(new Excel_tilte(elist.getBbsj(),1,1,8,8));
				et.add(new Excel_tilte("",1,1,9,18));
				et.add(new Excel_tilte("单位：万元",1,1,19,19));

				et.add(new Excel_tilte("投资计划",2,2,0,6));
				et.add(new Excel_tilte("资金",2,2,7,19));

				et.add(new Excel_tilte("序号",3,5,0,0));
				et.add(new Excel_tilte("项目单位",3,5,1,1));
				et.add(new Excel_tilte("项目个数",3,5,2,2));
				et.add(new Excel_tilte("计划文号",3,5,3,3));
				et.add(new Excel_tilte("以前年度计划",3,5,4,4));
				et.add(new Excel_tilte("本年计划",3,5,5,5));
				et.add(new Excel_tilte("合计",3,5,6,6));
				et.add(new Excel_tilte("结转",3,3,7,10));
				et.add(new Excel_tilte("本年拨入",3,5,11,11));
				et.add(new Excel_tilte("本年拨出",3,5,12,12));
				et.add(new Excel_tilte("当年结存",3,3,13,17));
				et.add(new Excel_tilte("调剂",3,5,18,18));
				et.add(new Excel_tilte("备注",3,5,19,19));


				et.add(new Excel_tilte("总数",4,5,7,7));
				et.add(new Excel_tilte("其中",4,4,8,10));
				et.add(new Excel_tilte("总数",4,5,13,13));
				et.add(new Excel_tilte("其中",4,4,14,17));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-3)+"及以前",5,5,8,8));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-2)+"",5,5,9,9));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-1)+"",5,5,10,10));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-3)+"及以前",5,5,14,14));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-2)+"",5,5,15,15));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-1)+"",5,5,16,16));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf()))+"",5,5,17,17));

				eldata.setEl(l);//将实体list放入类中
				eldata.setEt(et);//将表头内容设置到类里面
				HttpServletResponse response= getresponse();//获得一个HttpServletResponse
				Excel_export.excel_export(eldata,response);
			}else{
				elist.setGydw(MyUtil.getQueryDwTJ(elist.getGydw(), "gydwdm","sgydwdm"));
				elist.setXmnf(MyUtil.getQueryTJ(elist.getXmnf(), "xdnf"));
				elist.setJhnf(MyUtil.getQueryTJ(elist.getXmnf(), "xdnf"));
				elist.setXmjd(MyUtil.getQueryTJ(elist.getXmjd(), "decode(xmjd,'完工已验收','已竣工','完工未验收','已完工',xmjd)"));
				elist.setTsdq(MyUtil.getQueryTJ(elist.getTsdq() ,"tsdq"));
				elist.setXmlx(MyUtil.getQueryxmlxTJ(elist.getXmlx(), "jsxz","gcfl"));
				List<Excel_list> l = tjbbServer.getZjsydwbbsbhzb(elist);
				int i=1;
				for (Excel_list e : l) {
					e.setV_0(i+"");i++;
				}
				getRequest().getSession().setAttribute("getZjsydwbbsbhzb", l);
				if(l.size()>1000)
					JsonUtils.write(l.subList(0, 1000), getresponse().getWriter());
				else
					JsonUtils.write(l, getresponse().getWriter());
			}

		} catch (Exception e) {
			e.printStackTrace();
		}

	}


	//资金使用项目车购税汇总表
	public void getZjsyxmbbsbhzb(){
		try {

			if("1".equals(elist.getFlag())){
				HttpServletRequest request = ServletActionContext.getRequest();
				HttpSession session = request.getSession();
				String username = (String)session.getAttribute("truename");
//								System.out.println(elist.getNf());
				List<Excel_list> l = (List<Excel_list>) session.getAttribute("getZjsyxmbbsbhzb");
				ExcelData eldata=new ExcelData();//创建一个类
				eldata.setTitleName("公路建设车购税、省补合计资金使用情况汇总表（按项目统计）");//设置第一行
				eldata.setSheetName("sheet1");//设置sheeet名
				eldata.setFileName("公路建设车购税、省补合计资金使用情况汇总表（按项目统计）");//设置文件名
				List<Excel_tilte> et=new ArrayList<Excel_tilte>();//创建一个list存放表头
				et.add(new Excel_tilte("填报单位：",1,1,0,0));
				et.add(new Excel_tilte(username,1,1,1,1));
				et.add(new Excel_tilte("",1,1,2,6));
				et.add(new Excel_tilte("数据统计截止时间：",1,1,7,7));
				et.add(new Excel_tilte(elist.getBbsj(),1,1,8,8));
				et.add(new Excel_tilte("",1,1,9,18));
				et.add(new Excel_tilte("单位：万元",1,1,19,19));
				et.add(new Excel_tilte("投资计划",2,2,0,6));
				et.add(new Excel_tilte("资金",2,2,7,19));
				et.add(new Excel_tilte("序号",3,5,0,0));
				et.add(new Excel_tilte("项目单位",3,5,1,1));
				et.add(new Excel_tilte("项目个数",3,5,2,2));
				et.add(new Excel_tilte("计划文号",3,5,3,3));
				et.add(new Excel_tilte("以前年度计划",3,5,4,4));
				et.add(new Excel_tilte("本年计划",3,5,5,5));
				et.add(new Excel_tilte("合计",3,5,6,6));
				et.add(new Excel_tilte("结转",3,3,7,10));
				et.add(new Excel_tilte("本年拨入",3,5,11,11));
				et.add(new Excel_tilte("本年拨出",3,5,12,12));
				et.add(new Excel_tilte("当年结存",3,3,13,17));
				et.add(new Excel_tilte("调剂",3,5,18,18));
				et.add(new Excel_tilte("备注",3,5,19,19));
				et.add(new Excel_tilte("总数",4,5,7,7));
				et.add(new Excel_tilte("其中",4,4,8,10));
				et.add(new Excel_tilte("总数",4,5,13,13));
				et.add(new Excel_tilte("其中",4,4,14,17));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-3)+"及以前",5,5,8,8));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-2)+"",5,5,9,9));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-1)+"",5,5,10,10));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-3)+"及以前",5,5,14,14));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-2)+"",5,5,15,15));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf())-1)+"",5,5,16,16));
				et.add(new Excel_tilte((Integer.parseInt(elist.getNf()))+"",5,5,17,17));

				eldata.setEl(l);//将实体list放入类中
				eldata.setEt(et);//将表头内容设置到类里面
				HttpServletResponse response= getresponse();//获得一个HttpServletResponse
				Excel_export.excel_export(eldata,response);
			}else{
				elist.setGydw(MyUtil.getQueryDwTJ(elist.getGydw(), "gydwdm","sgydwdm"));
				elist.setXmnf(MyUtil.getQueryTJ(elist.getXmnf(), "xdnf"));
				elist.setXmlx(MyUtil.getQueryxmlxTJ(elist.getXmlx(), "jsxz","gcfl"));
				elist.setXmjd(MyUtil.getQueryTJ(elist.getXmjd(), "decode(xmjd,'完工已验收','已竣工','完工未验收','已完工',xmjd)"));
				elist.setTsdq(MyUtil.getQueryTJ(elist.getTsdq() ,"tsdq"));
				List<Excel_list> l = tjbbServer.getZjsyxmbbsbhzb(elist);
				int i=1;
				for (Excel_list e : l) {
					e.setV_0(i+"");i++;
				}
				getRequest().getSession().setAttribute("getZjsyxmbbsbhzb", l);
				if(l.size()>1000)
					JsonUtils.write(l.subList(0, 1000), getresponse().getWriter());
				else
					JsonUtils.write(l, getresponse().getWriter());
			}

		} catch (Exception e) {
			e.printStackTrace();
		}

	}



	public void getbbfwqk() {
		try {
			if("0".equals(elist.getFlag())){
				elist.setGydw(MyUtil.getQueryTJ(elist.getGydw(), "t.id"));
				elist.setYf(MyUtil.getQueryTJ(elist.getYf(), "substr(yf,6,2)"));
				List<Excel_list> list = tjbbServer.getbbfwqk(elist);
				getRequest().getSession().setAttribute("getbbfwqk", list);

				JsonUtils.write(list, getresponse().getWriter());
			}else{
				HttpServletRequest request = ServletActionContext.getRequest();
				HttpSession session = request.getSession();
//						System.out.println(elist.getNf());
				List<Excel_list> l = (List<Excel_list>) session.getAttribute("getbbfwqk");
				ExcelData eldata=new ExcelData();//创建一个类
				eldata.setTitleName(" 各单位报表访问情况");//设置第一行
				eldata.setSheetName("sheet1");//设置sheeet名
				eldata.setFileName(" 各单位报表访问情况");//设置文件名

				List<Excel_tilte> et=new ArrayList<Excel_tilte>();//创建一个list存放表头
				et.add(new Excel_tilte("单位名称",1,1,0,0));
				et.add(new Excel_tilte("报表名称",1,1,1,1));
				et.add(new Excel_tilte("统计月份",1,1,2,2));
				et.add(new Excel_tilte("访问次数",1,1,3,3));
				eldata.setEl(l);//将实体list放入类中
				eldata.setEt(et);//将表头内容设置到类里面
				HttpServletResponse response= getresponse();//获得一个HttpServletResponse
				Excel_export.excel_export(eldata,response);

			}
		}catch (Exception e) {
			e.printStackTrace();
		}
	}

	public void getbbtbqk() {
		try {
			if("0".equals(elist.getFlag())){
				elist.setGydw(MyUtil.getQueryTJ(elist.getGydw(), "d.id"));
				elist.setYf(MyUtil.getQueryTJ(elist.getYf(), "substr(v_2,6,2)"));
				List<Excel_list> list = tjbbServer.getbbtbqk(elist);
				getRequest().getSession().setAttribute("getbbtbqk", list);

				JsonUtils.write(list, getresponse().getWriter());
			}else{
				HttpServletRequest request = ServletActionContext.getRequest();
				HttpSession session = request.getSession();
//						System.out.println(elist.getNf());
				List<Excel_list> l = (List<Excel_list>) session.getAttribute("getbbtbqk");
				ExcelData eldata=new ExcelData();//创建一个类
				eldata.setTitleName(" 各单位资金到位、资金拨付填写情况统计表");//设置第一行
				eldata.setSheetName("sheet1");//设置sheeet名
				eldata.setFileName(" 各单位资金到位、资金拨付填写情况统计表");//设置文件名

				List<Excel_tilte> et=new ArrayList<Excel_tilte>();//创建一个list存放表头
				et.add(new Excel_tilte("单位名称",1,1,0,0));
				et.add(new Excel_tilte("填报类别",1,1,1,1));
				et.add(new Excel_tilte("统计月份",1,1,2,2));
				et.add(new Excel_tilte("填报条数",1,1,3,3));
				eldata.setEl(l);//将实体list放入类中
				eldata.setEt(et);//将表头内容设置到类里面
				HttpServletResponse response= getresponse();//获得一个HttpServletResponse
				Excel_export.excel_export(eldata,response);

			}
		}catch (Exception e) {
			e.printStackTrace();
		}
	}
}
